Add (unsigned char) cast to ctype functions

Change validation of -t<number> to use return ptr of strtoul (not isdigit)
This commit is contained in:
dsl 2004-10-30 08:31:39 +00:00
parent e26801d6fb
commit c32255add6
2 changed files with 6 additions and 10 deletions

View File

@ -27,7 +27,7 @@
* isdntel - isdn4bsd telephone answering machine support
* ======================================================
*
* $Id: files.c,v 1.4 2003/10/06 09:43:27 itojun Exp $
* $Id: files.c,v 1.5 2004/10/30 08:31:39 dsl Exp $
*
* $FreeBSD$
*
@ -112,7 +112,7 @@ fill_list(void)
for (dp = readdir(dirp); dp != NULL; dp = readdir(dirp))
{
if (!isdigit(*(dp->d_name)))
if (!isdigit((unsigned char)*(dp->d_name)))
continue;
if ((new_entry = (struct onefile *) malloc(sizeof(struct onefile))) == NULL)

View File

@ -27,7 +27,7 @@
* isdntel - isdn4bsd telephone answering machine support
* ======================================================
*
* $Id: main.c,v 1.5 2003/10/06 09:43:27 itojun Exp $
* $Id: main.c,v 1.6 2004/10/30 08:31:39 dsl Exp $
*
* $FreeBSD$
*
@ -57,6 +57,7 @@ main(int argc, char **argv)
int i;
int kchar;
struct pollfd set[1];
char *ncp;
char *aliasfile = ALIASFILE;
int rrtimeout = REREADTIMEOUT;
@ -82,14 +83,9 @@ main(int argc, char **argv)
break;
case 't':
if (isdigit(*optarg))
{
rrtimeout = strtoul(optarg, NULL, 10);
}
else
{
rrtimeout = strtoul(optarg, &ncp, 10);
if (*ncp)
usage();
}
break;
case '?':