X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/5dd6771b28c257af405d7248639ed0e3bcdce38b..b3d4a4452c332fc3550db3fbdf9e02027b41e985:/sbr/m_atoi.c?ds=sidebyside diff --git a/sbr/m_atoi.c b/sbr/m_atoi.c index 174c4077..45855caf 100644 --- a/sbr/m_atoi.c +++ b/sbr/m_atoi.c @@ -1,6 +1,4 @@ - -/* - * m_atoi.c -- Parse a string representation of a message number, and +/* 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. * @@ -9,21 +7,17 @@ * complete copyright information. */ -#include +#include "h/mh.h" int m_atoi (char *str) { int i; - unsigned char *cp; + char *cp; for (i = 0, cp = str; *cp; cp++) { -#ifdef LOCALE - if (!isdigit(*cp)) -#else - if (*cp < '0' || *cp > '9') -#endif + if (!isdigit((unsigned char) *cp)) return 0; i *= 10;