summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'util.c')
-rw-r--r--util.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/util.c b/util.c
index 9d10498a66..40b4573660 100644
--- a/util.c
+++ b/util.c
@@ -2123,10 +2123,11 @@ break2:
s0 = ++s;
adj = 0;
- while (*++s && (s1 = strchr(hexdigit, *s))) {
+ if (!*++s || !(s1 = strchr(hexdigit, *s))) goto ret0;
+ do {
adj *= 16;
adj += (s1 - hexdigit) & 15;
- }
+ } while (*++s && (s1 = strchr(hexdigit, *s)));
if (*s == '.') {
aadj = 1.;