[HarfBuzz] harfbuzz: Branch 'master'
Behdad Esfahbod
behdad at kemper.freedesktop.org
Sat Nov 10 20:47:12 UTC 2018
src/hb-dsalgs.hh | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
New commits:
commit 534e1d7694c96f61e853daef481b41274d5d16d8
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Sat Nov 10 15:43:16 2018 -0500
Fix hb_bytes_t.cmp() for realz this time
diff --git a/src/hb-dsalgs.hh b/src/hb-dsalgs.hh
index e98566e7..511b2299 100644
--- a/src/hb-dsalgs.hh
+++ b/src/hb-dsalgs.hh
@@ -530,10 +530,12 @@ struct hb_bytes_t
inline int cmp (const hb_bytes_t &a) const
{
- if (!len) return 0; /* glibc's memcmp() args are declared nonnull. Meh. */
-
- int r = memcmp (a.arrayZ, arrayZ, len);
- if (r) return r;
+ unsigned int l = MIN(a.len, len);
+ if (l) /* glibc's memcmp() args are declared nonnull. Meh. */
+ {
+ int r = memcmp (a.arrayZ, arrayZ, l);
+ if (r) return r;
+ }
return a.len < len ? -1 : a.len > len ? +1 : 0;
}
More information about the HarfBuzz
mailing list