X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=sbr%2Fm_atoi.c;h=03bf0d08d8beb9320f1b23bf7944de87585e52d8;hp=221ff0cadfc41add3833a4205ac28a21265e8fad;hb=714b5c530ece27ea2835a313013f5b770163403c;hpb=6c42153ad9362cc676ea66563bf400d7511b3b68 diff --git a/sbr/m_atoi.c b/sbr/m_atoi.c index 221ff0c..03bf0d0 100644 --- a/sbr/m_atoi.c +++ b/sbr/m_atoi.c @@ -1,36 +1,33 @@ - /* - * m_atoi.c -- Parse a string representation of a message number, and - * -- return the numeric value of the message. If the string - * -- contains any non-digit characters, then return 0. - * - * $Id$ - * - * This code is Copyright (c) 2002, by the authors of nmh. See the - * COPYRIGHT file in the root directory of the nmh distribution for - * complete copyright information. - */ +** m_atoi.c -- Parse a string representation of a message number, and +** -- return the numeric value of the message. If the string +** -- contains any non-digit characters, then return 0. +** +** This code is Copyright (c) 2002, by the authors of nmh. See the +** COPYRIGHT file in the root directory of the nmh distribution for +** complete copyright information. +*/ #include int -m_atoi (char *str) +m_atoi(char *str) { - int i; - char *cp; + int i; + unsigned char *cp; - for (i = 0, cp = str; *cp; cp++) { + for (i = 0, cp = str; *cp; cp++) { #ifdef LOCALE - if (!isdigit(*cp)) + if (!isdigit(*cp)) #else - if (*cp < '0' || *cp > '9') + if (*cp < '0' || *cp > '9') #endif - return 0; + return 0; - i *= 10; - i += (*cp - '0'); - } + i *= 10; + i += (*cp - '0'); + } - return i; + return i; }