aboutsummaryrefslogtreecommitdiffstats
path: root/src/n3.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/n3.c')
-rw-r--r--src/n3.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/n3.c b/src/n3.c
index 0a3e1fd3..edf773c7 100644
--- a/src/n3.c
+++ b/src/n3.c
@@ -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) {