FreeCalypso > hg > freecalypso-hwlab
comparison uicc/writecmd.c @ 158:65a2a96386cd
fc-uicc-tool: hex string parsing with min and max length,
matching fc-simtool
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 07 Feb 2021 04:00:27 +0000 |
parents | 14dee03e9675 |
children |
comparison
equal
deleted
inserted
replaced
157:239ebdb8f2af | 158:65a2a96386cd |
---|---|
34 offset = strtoul(argv[1], 0, 0); | 34 offset = strtoul(argv[1], 0, 0); |
35 if (offset > 0x7FFF) { | 35 if (offset > 0x7FFF) { |
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 } |