Page MenuHomeFreeBSD

D62320.1796307828.diff
No OneTemporary

Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None

D62320.1796307828.diff

diff --git a/usr.sbin/binmiscctl/binmiscctl.c b/usr.sbin/binmiscctl/binmiscctl.c
--- a/usr.sbin/binmiscctl/binmiscctl.c
+++ b/usr.sbin/binmiscctl/binmiscctl.c
@@ -133,7 +133,7 @@
IBE_SYSCTL_NAME_LIST
};
-static void __dead2
+static void __dead2 __printflike(1, 2)
usage(const char *format, ...)
{
va_list args;
@@ -288,10 +288,10 @@
usage("Required argument missing\n");
if (strlen(argv[0]) > IBE_NAME_MAX)
usage("'%s' string length longer than IBE_NAME_MAX (%d)",
- IBE_NAME_MAX);
+ argv[0], IBE_NAME_MAX);
strlcpy(&xbe->xbe_name[0], argv[0], IBE_NAME_MAX);
- while ((ch = getopt_long(argc, argv, "epi:m:M:o:s:", add_opts, NULL))
+ while ((ch = getopt_long(argc, argv, "+epi:m:M:o:s:", add_opts, NULL))
!= -1) {
switch(ch) {
@@ -337,6 +337,12 @@
}
}
+ argc -= optind;
+ argv += optind;
+
+ if (argc != 0)
+ usage("Error: add only takes options: %s", argv[0]);
+
if (xbe->xbe_msize == 0) {
if (NULL != magic)
free(magic);
@@ -386,7 +392,7 @@
usage("Required argument missing\n");
if (strlen(argv[0]) > IBE_NAME_MAX)
usage("'%s' string length longer than IBE_NAME_MAX (%d)",
- IBE_NAME_MAX);
+ argv[0], IBE_NAME_MAX);
strlcpy(&xbe->xbe_name[0], argv[0], IBE_NAME_MAX);
return (0);

File Metadata

Mime Type
text/plain
Expires
Thu, Dec 3, 2:23 PM (18 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
42183275
Default Alt Text
D62320.1796307828.diff (1 KB)

Event Timeline