29 lines
1.1 KiB
Diff
29 lines
1.1 KiB
Diff
--- spectrwm.c
|
|
+++ spectrwm.c
|
|
@@ -9186,7 +9186,7 @@ setconfvalue(const char *selector, const char *value, int flags)
|
|
return (0);
|
|
|
|
bzero(s, sizeof s);
|
|
- if (sscanf(value, "ws[%d]:%1023c", &ws_id, s) != 2)
|
|
+ if (sscanf(value, "ws[%d]:%1023c", &ws_id, s) < 1 || !*s)
|
|
errx(1, "invalid entry, should be 'ws[<idx>]:name'");
|
|
ws_id--;
|
|
if (ws_id < 0 || ws_id >= workspace_limit)
|
|
@@ -9323,7 +9323,7 @@ setautorun(const char *selector, const char *value, int flags)
|
|
return (0);
|
|
|
|
bzero(s, sizeof s);
|
|
- if (sscanf(value, "ws[%d]:%1023c", &ws_id, s) != 2)
|
|
+ if (sscanf(value, "ws[%d]:%1023c", &ws_id, s) < 1 || !*s)
|
|
errx(1, "invalid autorun entry, should be 'ws[<idx>]:command'");
|
|
ws_id--;
|
|
if (ws_id < 0 || ws_id >= workspace_limit)
|
|
@@ -9394,7 +9394,7 @@ setlayout(const char *selector, const char *value, int flags)
|
|
|
|
bzero(s, sizeof s);
|
|
if (sscanf(value, "ws[%d]:%d:%d:%d:%d:%1023c",
|
|
- &ws_id, &mg, &ma, &si, &ar, s) != 6)
|
|
+ &ws_id, &mg, &ma, &si, &ar, s) < 5 || !*s)
|
|
errx(1, "invalid layout entry, should be 'ws[<idx>]:"
|
|
"<master_grow>:<master_add>:<stack_inc>:<always_raise>:"
|
|
"<type>'");
|