From 906f76fefd8f2e807f8f8e18da9b887206b4c1a8 Mon Sep 17 00:00:00 2001 From: Stathis Kamperis Date: Mon, 30 Mar 2009 07:48:36 +0000 Subject: [PATCH] vnconfig -l: print an error if supplied vn is unknown The code as it is has no effect, because `tmp' is never NULL. Make it behave as initially intended. Also, since we are here replace the printf() call with errx(). Approved-by: corecode@ --- usr.sbin/vnconfig/vnconfig.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-) diff --git a/usr.sbin/vnconfig/vnconfig.c b/usr.sbin/vnconfig/vnconfig.c index 66ec175..01a2c0f 100644 --- a/usr.sbin/vnconfig/vnconfig.c +++ b/usr.sbin/vnconfig/vnconfig.c @@ -290,10 +290,8 @@ getinfo( const char *vname ) } tmp++; } - if (tmp == NULL) { - printf("unknown vn device: %s", vname); - return 1; - } + if (*tmp == '\0') + errx(1, "unknown vn device: %s", vname); } snprintf(vnpath, sizeof(vnpath), "/dev/vn%d", i); -- 1.7.7.2