From 0e8b28ee6e64685ca9ae1f9ed0e4b0eaf31317b9 Mon Sep 17 00:00:00 2001 From: Sebastian Rasmussen Date: Sun, 5 Jul 2009 21:08:45 +0200 Subject: Fix bug in comparison when sorting keys in dictionaries. --- fitz/obj_dict.c | 3 +-- 1 file changed, 1 insertion(+), 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; } -- cgit v1.2.3