summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2019-12-19 11:58:18 -0500
committerGravatar Adam Chlipala <adam@chlipala.net>2019-12-19 11:58:18 -0500
commit58cb40ccda23b9424cc4cfcbd70fb94ae18665db (patch)
treefd5c050ba95f060aa49a0229c2b77b4c14f990bd
parent383e3a559b65432e9e2357dc35670ce147be96da (diff)
parent63b5253262fb180de320f0155bb17503748743e4 (diff)
Merge branch 'master' of ssh://github.com/urweb/urweb
-rw-r--r--src/c/urweb.c13
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) {