diff options
author | n_hibma <n_hibma@FreeBSD.org> | 1999-11-24 19:18:57 +0000 |
---|---|---|
committer | n_hibma <n_hibma@FreeBSD.org> | 1999-11-24 19:18:57 +0000 |
commit | e0cf3d9b909ef7c0f8e421deaace71ad77f4a655 (patch) | |
tree | e392a7e3e6292c184e9264ea9289d0059ab576bb /usr.sbin/usbd | |
parent | 3d54d3434fec937f572d6dfa7e3410633ac46a9a (diff) | |
download | FreeBSD-src-e0cf3d9b909ef7c0f8e421deaace71ad77f4a655.zip FreeBSD-src-e0cf3d9b909ef7c0f8e421deaace71ad77f4a655.tar.gz |
Avoid null dereference on verbose output.
Submitted-By: Doug Ambrisko <ambrisko@whistle.com>
Don't print a warning on exit status 0.
Diffstat (limited to 'usr.sbin/usbd')
-rw-r--r-- | usr.sbin/usbd/usbd.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/usr.sbin/usbd/usbd.c b/usr.sbin/usbd/usbd.c index 33e29f2..f5371ae 100644 --- a/usr.sbin/usbd/usbd.c +++ b/usr.sbin/usbd/usbd.c @@ -611,15 +611,15 @@ find_action(struct usb_device_info *devinfo) (action->protocol == WILDCARD_INT || action->protocol == devinfo->protocol)) { /* found match !*/ - break; + if (verbose) + printf("%s: Found action '%s' for %s, %s\n", + __progname, action->name, + devinfo->product, devinfo->vendor); + return(action); } } - if (verbose) - printf("%s: Found action '%s' for %s, %s\n", - __progname, action->name, - devinfo->product, devinfo->vendor); - return(action); + return NULL; } void @@ -695,7 +695,7 @@ execute_command(char *cmd) } else if (status == 127) { fprintf(stderr, "%s: Shell failed for '%s'\n", __progname, cmd); - } else if (WIFEXITED(status)) { + } else if (WIFEXITED(status) && WEXITSTATUS(status)) { fprintf(stderr, "%s: '%s' returned %d\n", __progname, cmd, WEXITSTATUS(status)); } else if (WIFSIGNALED(status)) { |