summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fitz/obj_simple.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/fitz/obj_simple.c b/fitz/obj_simple.c
index 69283f26..8736f89a 100644
--- a/fitz/obj_simple.c
+++ b/fitz/obj_simple.c
@@ -280,9 +280,17 @@ fz_objcmp(fz_obj *a, fz_obj *b)
case FZ_STRING:
if (a->u.s.len < b->u.s.len)
- return -1;
- if (a->u.s.len > b->u.s.len)
+ {
+ if (memcmp(a->u.s.buf, b->u.s.buf, a->u.s.len) <= 0)
+ return -1;
return 1;
+ }
+ if (a->u.s.len > b->u.s.len)
+ {
+ if (memcmp(a->u.s.buf, b->u.s.buf, b->u.s.len) >= 0)
+ return 1;
+ return -1;
+ }
return memcmp(a->u.s.buf, b->u.s.buf, a->u.s.len);
case FZ_NAME: