#ifndef lint static char rcsid[] = "$Id: is_num_str.c,v 1.1 1997/02/28 14:02:50 tommy Exp $"; #endif #include #include #include #include "play.h" int check_numarg(char *arg, char opt) { if (!is_num_str(arg)) { fprintf(stderr, "%s: %s: invalid argument for -%c\n", myname, arg, opt); exit(1); } return atoi(arg); } int is_num_str(const char *str) { while (*str) { if (!isdigit(*str)) return FALSE; str++; } return TRUE; }