X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/13f84dd50ca5754391dbd3296a5c7425f9363600..c576ad2674c37a1c63f004c71049998f38854c64:/sbr/m_atoi.c diff --git a/sbr/m_atoi.c b/sbr/m_atoi.c index dffc799b..87a78283 100644 --- a/sbr/m_atoi.c +++ b/sbr/m_atoi.c @@ -1,11 +1,7 @@ - -/* - * 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. * - * $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. @@ -18,14 +14,10 @@ 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;