From: <ml...@ma...> - 2009-04-22 12:09:29
|
Author: mlu Date: 2009-04-22 12:09:15 +0200 (Wed, 22 Apr 2009) New Revision: 1505 Modified: trunk/src/helper/binarybuffer.c Log: Fix str_to_buf problem, thanks Andy Chenee Modified: trunk/src/helper/binarybuffer.c =================================================================== --- trunk/src/helper/binarybuffer.c 2009-04-22 07:34:47 UTC (rev 1504) +++ trunk/src/helper/binarybuffer.c 2009-04-22 10:09:15 UTC (rev 1505) @@ -244,7 +244,7 @@ int str_to_buf(const char *str, int str_len, u8 *buf, int buf_len, int radix) { char *charbuf; - char tmp; + u32 tmp; float factor; u8 *b256_buf; int b256_len; @@ -303,7 +303,7 @@ tmp = (tmp - 'A' + 10); else continue; /* skip characters other than [0-9,a-f,A-F] */ - if (tmp >= radix) + if (tmp >= (u32)radix) continue; /* skip digits invalid for the current radix */ for (j = 0; j < b256_len; j++) |