Page MenuHomeFreeBSD

D60815.1794845684.diff
No OneTemporary

Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None

D60815.1794845684.diff

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

Mime Type
text/plain
Expires
Mon, Nov 16, 4:14 PM (14 h, 39 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41760893
Default Alt Text
D60815.1794845684.diff (1 KB)

Event Timeline