X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fnet%2Fnmeap%2Fsrc%2Fnmeap01.c;h=e09edc96f25b456bdf1ab754b9155c4eb16b4b9b;hb=9a5ad349a1f6b952ae68f25d8a1d62b7c2633cff;hp=c391242846910b4c5ba21bcc4d38282190fa9e0b;hpb=4e554f69f2f6f560ee788833da4304a0d45b853b;p=bertos.git diff --git a/bertos/net/nmeap/src/nmeap01.c b/bertos/net/nmeap/src/nmeap01.c index c3912428..e09edc96 100644 --- a/bertos/net/nmeap/src/nmeap01.c +++ b/bertos/net/nmeap/src/nmeap01.c @@ -295,7 +295,7 @@ int nmeap_tokenize(nmeap_context_t *context) */ int nmeap_process(nmeap_context_t *context) { - int id; + int id = 0; int i; nmeap_sentence_t *s; @@ -389,7 +389,7 @@ int nmeap_parse(nmeap_context_t *context,char ch) case 1: /* allow numbers even though it isn't usually done */ /* a proprietary id might have a numeral */ - if (isalnum(ch)) { + if (isalnum((unsigned char)ch)) { /* store name separately */ context->input_name[context->input_count - 2] = ch; /* checksum */ @@ -428,7 +428,7 @@ int nmeap_parse(nmeap_context_t *context,char ch) /* LOOKING FOR FIRST CHECKSUM CHARACTER */ case 3: /* must be upper case hex digit */ - if (isxdigit(ch) && (ch <= 'F')) { + if (isxdigit((unsigned char)ch) && (ch <= 'F')) { /* got first checksum byte */ context->input_state = 4; context->icks = HEXTOBIN(ch) << 4; @@ -443,7 +443,7 @@ int nmeap_parse(nmeap_context_t *context,char ch) /* LOOKING FOR SECOND CHECKSUM CHARACTER */ case 4: /* must be upper case hex digit */ - if (isxdigit(ch) && (ch <= 'F')) { + if (isxdigit((unsigned char)ch) && (ch <= 'F')) { /* got second checksum byte */ context->input_state = 5; context->icks += HEXTOBIN(ch);