Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F177588262
D60815.1794804649.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
D60815.1794804649.diff
View Options
diff --git a/usr.sbin/sysconf/sysconf-targets.c b/usr.sbin/sysconf/sysconf-targets.c
--- a/usr.sbin/sysconf/sysconf-targets.c
+++ b/usr.sbin/sysconf/sysconf-targets.c
@@ -70,7 +70,13 @@
if (nmatch == 1)
return (found);
if (nmatch > 1) {
- warnx("ambiguous %s `%s'; matches %s", what, token, matches);
+ /*
+ * snprintf(3) returns the length that would have been
+ * written, so off >= sizeof(matches) means the list was
+ * truncated.
+ */
+ warnx("ambiguous %s `%s'; matches %s%s", what, token, matches,
+ off >= sizeof(matches) ? " (truncated)" : "");
usage();
}
return (NULL);
@@ -127,14 +133,14 @@
}
for (p = argv[n] + 1; *p != '\0'; p++) {
o = strchr(OPTSTRING, *p);
+ /* Does the option take an argument? */
if (o != NULL && o[1] == ':') {
- /* Takes an argument */
- if (p[1] != '\0') {
- ;
- /* attached: rest of argv[n] */
- } else if (n + 1 < argc) {
+ /*
+ * Is the option argument in the next
+ * argv entry?
+ */
+ if (p[1] == '\0' && n + 1 < argc) {
n++;
- /* separate argv */
}
break;
}
diff --git a/usr.sbin/sysconf/sysconf_priv.h b/usr.sbin/sysconf/sysconf_priv.h
--- a/usr.sbin/sysconf/sysconf_priv.h
+++ b/usr.sbin/sysconf/sysconf_priv.h
@@ -37,7 +37,7 @@
#define __unused /* not all compilers support attributes */
#endif
-#define SYSCONF_VERSION "2.2 2026-09-22"
+#define SYSCONF_VERSION "2.2.1 2026-10-17"
/* getopt(3) optstring; shared by parse_options() and find_target() */
#define OPTSTRING "AacdDEeFf:hij:k:lLnNqR:svVx"
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 16, 4:50 AM (3 h, 15 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41760893
Default Alt Text
D60815.1794804649.diff (1 KB)
Attached To
Mode
D60815: sysconf: report a truncated keyword match list
Attached
Detach File
Event Timeline