diff options
author | Chris Kuethe <chris.kuethe@gmail.com> | 2006-09-28 19:53:32 +0000 |
---|---|---|
committer | Chris Kuethe <chris.kuethe@gmail.com> | 2006-09-28 19:53:32 +0000 |
commit | 11b5d1ef6ee9f68dde247ed6cddcc02f82d09070 (patch) | |
tree | 820ea0425b072932894d76e29bfd1a5354d3567b /gpsflash.c | |
parent | 8041ccf4917dad4da3b9a4f827084a6785049960 (diff) | |
download | gpsd-11b5d1ef6ee9f68dde247ed6cddcc02f82d09070.tar.gz |
use the hex2bin function that libgpsd now provides
Diffstat (limited to 'gpsflash.c')
-rw-r--r-- | gpsflash.c | 27 |
1 files changed, 0 insertions, 27 deletions
@@ -663,30 +663,3 @@ srec_check(char *data){ } return 0; } - -int hex2bin(char *s){ - int a, b; - - a = s[0] & 0xff; - b = s[1] & 0xff; - - if ((a >= 'a') && (a <= 'z')) - a = a + 10 - 'a'; - else if ((a >= 'A') && (a <= 'Z')) - a = a + 10 - 'A'; - else if ((a >= '0') && (a <= '9')) - a -= '0'; - else - return -1; - - if ((b >= 'a') && (b <= 'z')) - b = b + 10 - 'a'; - else if ((b >= 'A') && (b <= 'Z')) - b = b + 10 - 'A'; - else if ((b >= '0') && (b <= '9')) - b -= '0'; - else - return -1; - - return ((a<<4) + b); -} |