home *** CD-ROM | disk | FTP | other *** search
- /* History:
- 5/1/91 DJB baseline public domain
- */
-
- /*
-
- int numeric(s) char *s; returns 1 if s is entirely composed of the
- digits 0 through 9, 0 otherwise.
-
- */
-
- #include "numeric.h"
-
- int numeric(s)
- char *s;
- {
- while (*s)
- {
- if ((*s != '0') && (*s != '1') && (*s != '2') && (*s != '3') && (*s != '4')
- && (*s != '5') && (*s != '6') && (*s != '7') && (*s != '8') && (*s != '9'))
- return 0;
- ++s;
- }
- return 1;
- }
-