From 6e69200a2aadbc6bba35ffb4a058c14286b84f46 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 25 Jul 2014 12:30:47 -0400 Subject: [PATCH] Fix snprintf() format Patch from Maks Naumov. Fixes https://github.com/behdad/harfbuzz/pull/22 --- src/hb-shape.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/hb-shape.cc b/src/hb-shape.cc index efe3bffc3..812cf5919 100644 --- a/src/hb-shape.cc +++ b/src/hb-shape.cc @@ -257,18 +257,18 @@ hb_feature_to_string (hb_feature_t *feature, { s[len++] = '['; if (feature->start) - len += MAX (0, snprintf (s + len, ARRAY_LENGTH (s) - len, "%d", feature->start)); + len += MAX (0, snprintf (s + len, ARRAY_LENGTH (s) - len, "%u", feature->start)); if (feature->end != feature->start + 1) { s[len++] = ':'; if (feature->end != (unsigned int) -1) - len += MAX (0, snprintf (s + len, ARRAY_LENGTH (s) - len, "%d", feature->end)); + len += MAX (0, snprintf (s + len, ARRAY_LENGTH (s) - len, "%u", feature->end)); } s[len++] = ']'; } if (feature->value > 1) { s[len++] = '='; - len += MAX (0, snprintf (s + len, ARRAY_LENGTH (s) - len, "%d", feature->value)); + len += MAX (0, snprintf (s + len, ARRAY_LENGTH (s) - len, "%u", feature->value)); } assert (len < ARRAY_LENGTH (s)); len = MIN (len, size - 1);