Mercurial > hg > Applications > mh
view sbr/m_atoi.c @ 3:f89a9a79e124
utf-8
author | kono |
---|---|
date | Wed, 20 Apr 2005 00:25:01 +0900 |
parents | bce86c4163a3 |
children | 441a2190cfae |
line wrap: on
line source
/* m_atoi.c - parse a string representation of a message number */ #ifndef lint static char ident[] = "@(#)$Id$"; #endif /* lint */ #include "../h/mh.h" m_atoi (str) register char *str; { register int i; register char *cp; i = 0; cp = str; while (*cp) { #ifdef LOCALE if (!isdigit(*cp)) #else if (*cp < '0' || *cp > '9') #endif return 0; i *= 10; i += *cp++ - '0'; } return i; }