Module Name: src
Committed By: dholland
Date: Sat Dec 31 10:13:15 UTC 2016
Modified Files:
src/usr.bin/usbhidaction: usbhidaction.c
Log Message:
PR 51754 Charlotte Koch: fix -v output of config parser.
To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/usr.bin/usbhidaction/usbhidaction.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/usbhidaction/usbhidaction.c
diff -u src/usr.bin/usbhidaction/usbhidaction.c:1.26 src/usr.bin/usbhidaction/usbhidaction.c:1.27
--- src/usr.bin/usbhidaction/usbhidaction.c:1.26 Tue Sep 29 14:27:00 2015
+++ src/usr.bin/usbhidaction/usbhidaction.c Sat Dec 31 10:13:15 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: usbhidaction.c,v 1.26 2015/09/29 14:27:00 christos Exp $ */
+/* $NetBSD: usbhidaction.c,v 1.27 2016/12/31 10:13:15 dholland Exp $ */
/*
* Copyright (c) 2000, 2002 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: usbhidaction.c,v 1.26 2015/09/29 14:27:00 christos Exp $");
+__RCSID("$NetBSD: usbhidaction.c,v 1.27 2016/12/31 10:13:15 dholland Exp $");
#endif
#include <stdio.h>
@@ -392,9 +392,17 @@ parse_conf(const char *conf, report_desc
cmd->value = -1;
}
- if (verbose)
- (void)printf("PARSE:%d %s, %d, '%s'\n", cmd->line, name,
- cmd->value, cmd->action);
+ if (verbose) {
+ char valuebuf[16];
+
+ if (cmd->anyvalue)
+ snprintf(valuebuf, sizeof(valuebuf), "%s", "*");
+ else
+ snprintf(valuebuf, sizeof(valuebuf), "%d",
+ cmd->value);
+ (void)printf("PARSE:%d %s, %s, '%s'\n", cmd->line, name,
+ valuebuf, cmd->action);
+ }
}
(void)fclose(f);
return (cmds);