sscanf() %zn ought to take a ssize_t *
This commit is contained in:
parent
052738b8f4
commit
541a4328db
|
@ -1254,15 +1254,16 @@ char *termkey_strpkey(TermKey *tk, const char *str, TermKeyKey *key, TermKeyForm
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t nbytes;
|
size_t nbytes;
|
||||||
|
ssize_t snbytes;
|
||||||
char *endstr;
|
char *endstr;
|
||||||
|
|
||||||
if((endstr = termkey_lookup_keyname(tk, str, &key->code.sym))) {
|
if((endstr = termkey_lookup_keyname(tk, str, &key->code.sym))) {
|
||||||
key->type = TERMKEY_TYPE_KEYSYM;
|
key->type = TERMKEY_TYPE_KEYSYM;
|
||||||
str = endstr;
|
str = endstr;
|
||||||
}
|
}
|
||||||
else if(sscanf(str, "F%d%zn", &key->code.number, &nbytes) == 1) {
|
else if(sscanf(str, "F%d%zn", &key->code.number, &snbytes) == 1) {
|
||||||
key->type = TERMKEY_TYPE_FUNCTION;
|
key->type = TERMKEY_TYPE_FUNCTION;
|
||||||
str += nbytes;
|
str += snbytes;
|
||||||
}
|
}
|
||||||
// Unicode must be last
|
// Unicode must be last
|
||||||
else if(parse_utf8((unsigned char *)str, strlen(str), &key->code.codepoint, &nbytes) == TERMKEY_RES_KEY) {
|
else if(parse_utf8((unsigned char *)str, strlen(str), &key->code.codepoint, &nbytes) == TERMKEY_RES_KEY) {
|
||||||
|
|
Loading…
Reference in New Issue