From: Roland McGrath Date: Thu, 12 Jan 2006 09:45:56 +0000 (+0000) Subject: 2005-11-14 Dmitry V. Levin X-Git-Tag: v4.5.18~309 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=48a035fb6f4300c0d2f9341eaf63f1d95c5ba2ae;p=strace 2005-11-14 Dmitry V. Levin * syscall.c (qual_syscall): Handle numeric syscall specification. Fixes RH#174798. * syscall.c (qual_signal, qual_options): Remove redundant argument check. --- diff --git a/syscall.c b/syscall.c index 241dfa45..c84a3dee 100644 --- a/syscall.c +++ b/syscall.c @@ -293,6 +293,13 @@ qual_syscall(s, opt, not) int i; int rc = -1; + if (isdigit((unsigned char)*s)) { + int i = atoi(s); + if (i < 0 || i >= nsyscalls) + return -1; + qualify_one(i, opt, not); + return 0; + } for (i = 0; i < nsyscalls; i++) { if (strcmp(s, sysent[i].sys_name) == 0) { qualify_one(i, opt, not); @@ -311,7 +318,7 @@ qual_signal(s, opt, not) int i; char buf[32]; - if (s && *s && isdigit((unsigned char)*s)) { + if (isdigit((unsigned char)*s)) { int signo = atoi(s); if (signo < 0 || signo >= MAX_QUALS) return -1; @@ -349,7 +356,7 @@ qual_desc(s, opt, not) const struct qual_options *opt; int not; { - if (s && *s && isdigit((unsigned char)*s)) { + if (isdigit((unsigned char)*s)) { int desc = atoi(s); if (desc < 0 || desc >= MAX_QUALS) return -1;