Mercurial > hg > Applications > mh
view sbr/m_atoi.c @ 17:76d91e545ea8 default tip
addrsbr and dtimep fix
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 24 Nov 2014 14:49:25 +0900 |
parents | 441a2190cfae |
children |
line wrap: on
line source
/* m_atoi.c - parse a string representation of a message number */ #ifndef lint static char ident[] = "@(#)$Id: m_atoi.c,v 1.1.1.1 2005/04/18 14:46:06 kono Exp $"; #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; }