diff options
author | David Robillard <d@drobilla.net> | 2018-09-16 22:45:48 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2018-09-16 22:49:42 +0200 |
commit | e7f9b51da8597dc70a432b4272429188e4ce69e1 (patch) | |
tree | 33ff448fd044b06040b18af4f689bd22d6447632 /src/n3.c | |
parent | b1824007fb21d9074006023174c34ea911dc7840 (diff) | |
download | serd-e7f9b51da8597dc70a432b4272429188e4ce69e1.tar.gz serd-e7f9b51da8597dc70a432b4272429188e4ce69e1.tar.bz2 serd-e7f9b51da8597dc70a432b4272429188e4ce69e1.zip |
Use strtoul instead of sscanf for converting hex
Diffstat (limited to 'src/n3.c')
-rw-r--r-- | src/n3.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -77,8 +77,9 @@ read_UCHAR(SerdReader* reader, Ref dest, uint32_t* char_code) } } - uint32_t code; - sscanf((const char*)buf, "%X", &code); + char* endptr = NULL; + const uint32_t code = strtoul((const char*)buf, &endptr, 16); + assert(endptr == (char*)buf + length); unsigned size = 0; if (code < 0x00000080) { |