diff options
author | Paul LeoNerd Evans <leonerd@leonerd.org.uk> | 2012-01-20 17:01:38 +0000 |
---|---|---|
committer | Paul LeoNerd Evans <leonerd@leonerd.org.uk> | 2012-01-20 17:01:38 +0000 |
commit | 541a4328dbf4104d1456341b4a179fbd2390ca80 (patch) | |
tree | faa1ad7171dcceea705bbc94526c5d8a92971a8f | |
parent | 052738b8f422060a09a7f5eaadc6b1c19fbcc61d (diff) | |
download | termo-541a4328dbf4104d1456341b4a179fbd2390ca80.tar.gz termo-541a4328dbf4104d1456341b4a179fbd2390ca80.tar.xz termo-541a4328dbf4104d1456341b4a179fbd2390ca80.zip |
sscanf() %zn ought to take a ssize_t *
-rw-r--r-- | termkey.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -1254,15 +1254,16 @@ char *termkey_strpkey(TermKey *tk, const char *str, TermKeyKey *key, TermKeyForm } size_t nbytes; + ssize_t snbytes; char *endstr; if((endstr = termkey_lookup_keyname(tk, str, &key->code.sym))) { key->type = TERMKEY_TYPE_KEYSYM; 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; - str += nbytes; + str += snbytes; } // Unicode must be last else if(parse_utf8((unsigned char *)str, strlen(str), &key->code.codepoint, &nbytes) == TERMKEY_RES_KEY) { |