diff options
author | Simon Van Casteren <simonvancasteren@localhost.localdomain> | 2019-12-17 13:35:20 +0100 |
---|---|---|
committer | Simon Van Casteren <simonvancasteren@localhost.localdomain> | 2019-12-17 14:14:47 +0100 |
commit | 10eb72ad6a4fc0426305e3bd85893f76cb772545 (patch) | |
tree | 320b09699b8c000b567db404ee579c6ca733e963 | |
parent | f48703bf1b39c94c941ba101c3d2fd56a78d8289 (diff) |
Remove sscanf from blob processing
-rw-r--r-- | src/c/urweb.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/c/urweb.c b/src/c/urweb.c index a01b4aae..8ffe7dd3 100644 --- a/src/c/urweb.c +++ b/src/c/urweb.c @@ -3421,10 +3421,19 @@ uw_Basis_blob uw_Basis_stringToBlob_error(uw_context ctx, uw_Basis_string s, siz s += 2; while (*s) { + char a = s[0]; + s += 1; + char b; + if (*s){ + b = s[0]; + } else { + b = 0; + } int n; - sscanf(s, "%02x", &n); + char buf[3] = {a, b, 0}; + n = strtol(buf, NULL, 16); *r++ = n; - s += 2; + s += 1; } } else { while (*s) { |