FreeCalypso > hg > freecalypso-hwlab
comparison simtool/writecmd.c @ 151:d515cfbb3f39
fc-simtool: hex string parsing: add minimum length parameter
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 07 Feb 2021 00:18:30 +0000 |
parents | 54e33e9238b6 |
children |
comparison
equal
deleted
inserted
replaced
150:54e33e9238b6 | 151:d515cfbb3f39 |
---|---|
34 offset = strtoul(argv[1], 0, 0); | 34 offset = strtoul(argv[1], 0, 0); |
35 if (offset > 0xFFFF) { | 35 if (offset > 0xFFFF) { |
36 fprintf(stderr, "error: offset argument is out of range\n"); | 36 fprintf(stderr, "error: offset argument is out of range\n"); |
37 return(-1); | 37 return(-1); |
38 } | 38 } |
39 rc = decode_hex_data_from_string(argv[2], data, 255); | 39 rc = decode_hex_data_from_string(argv[2], data, 1, 255); |
40 if (rc < 0) | 40 if (rc < 0) |
41 return(rc); | 41 return(rc); |
42 len = rc; | 42 len = rc; |
43 return update_bin_op(offset, data, len); | 43 return update_bin_op(offset, data, len); |
44 } | 44 } |