Detect base 16 in cmd criteria
Try to detect base 16 numbers given to `con_id` and `id` for command criteria
by setting the base of strtol to 0. This should also detect octal.
This is necessary because mouse bindings now may be serialized as hex as of
5c32de4
.
This commit is contained in:
parent
be2634c91f
commit
a74662052a
|
@ -335,7 +335,7 @@ void cmd_criteria_add(I3_CMD, char *ctype, char *cvalue) {
|
||||||
|
|
||||||
if (strcmp(ctype, "con_id") == 0) {
|
if (strcmp(ctype, "con_id") == 0) {
|
||||||
char *end;
|
char *end;
|
||||||
long parsed = strtol(cvalue, &end, 10);
|
long parsed = strtol(cvalue, &end, 0);
|
||||||
if (parsed == LONG_MIN ||
|
if (parsed == LONG_MIN ||
|
||||||
parsed == LONG_MAX ||
|
parsed == LONG_MAX ||
|
||||||
parsed < 0 ||
|
parsed < 0 ||
|
||||||
|
@ -350,7 +350,7 @@ void cmd_criteria_add(I3_CMD, char *ctype, char *cvalue) {
|
||||||
|
|
||||||
if (strcmp(ctype, "id") == 0) {
|
if (strcmp(ctype, "id") == 0) {
|
||||||
char *end;
|
char *end;
|
||||||
long parsed = strtol(cvalue, &end, 10);
|
long parsed = strtol(cvalue, &end, 0);
|
||||||
if (parsed == LONG_MIN ||
|
if (parsed == LONG_MIN ||
|
||||||
parsed == LONG_MAX ||
|
parsed == LONG_MAX ||
|
||||||
parsed < 0 ||
|
parsed < 0 ||
|
||||||
|
|
Loading…
Reference in New Issue