summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Rasmussen <sebras@hotmail.com>2009-07-05 21:08:45 +0200
committerSebastian Rasmussen <sebras@hotmail.com>2009-07-05 21:08:45 +0200
commit0e8b28ee6e64685ca9ae1f9ed0e4b0eaf31317b9 (patch)
treea8ab1b88338dfcd53b1a79401ecca42b7cb1abd5
parenta71050183e7f62a5667b41fe802335b1ef1018b8 (diff)
downloadmupdf-0e8b28ee6e64685ca9ae1f9ed0e4b0eaf31317b9.tar.xz
Fix bug in comparison when sorting keys in dictionaries.
-rw-r--r--fitz/obj_dict.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fitz/obj_dict.c b/fitz/obj_dict.c
index 0a654f8f..46ac1900 100644
--- a/fitz/obj_dict.c
+++ b/fitz/obj_dict.c
@@ -20,8 +20,7 @@ static inline int keystrcmp(fz_obj *key, char *s)
if (fz_isname(key))
return strcmp(fz_toname(key), s);
if (fz_isstring(key))
- if (strlen(s) == fz_tostrlen(key))
- return memcmp(fz_tostrbuf(key), s, fz_tostrlen(key));
+ return memcmp(fz_tostrbuf(key), s, 1 + MIN(fz_tostrlen(key), strlen(s)));
return -1;
}