diff options
author | Konstantin Ritt <ritt.ks@gmail.com> | 2013-08-30 01:56:44 +0300 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-08-30 20:24:43 +0200 |
commit | 029b68ce92b77a57d701f0af3bbadedffcf262cf (patch) | |
tree | b91d2c63a2e47ff106d7e061c48558a811bccbef /src/3rdparty/harfbuzz-ng/src/hb-buffer-serialize.cc | |
parent | fc9c5ffc5fe6f1404ec73134068aca955f69ad18 (diff) |
[1/2] Update bundled HarfBuzz-NG sources up to 0.9.20
Change-Id: I8649bbe608cb2f79c721c900c03fd0139a8c0cd1
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/3rdparty/harfbuzz-ng/src/hb-buffer-serialize.cc')
-rw-r--r-- | src/3rdparty/harfbuzz-ng/src/hb-buffer-serialize.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-buffer-serialize.cc b/src/3rdparty/harfbuzz-ng/src/hb-buffer-serialize.cc index dc47ba73e0..eac69000dd 100644 --- a/src/3rdparty/harfbuzz-ng/src/hb-buffer-serialize.cc +++ b/src/3rdparty/harfbuzz-ng/src/hb-buffer-serialize.cc @@ -100,10 +100,10 @@ _hb_buffer_serialize_glyphs_json (hb_buffer_t *buffer, *p++ = '"'; } else - p += snprintf (p, ARRAY_LENGTH (b) - (p - b), "%u", info[i].codepoint); + p += MAX (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), "%u", info[i].codepoint)); if (!(flags & HB_BUFFER_SERIALIZE_FLAG_NO_CLUSTERS)) { - p += snprintf (p, ARRAY_LENGTH (b) - (p - b), ",\"cl\":%u", info[i].cluster); + p += MAX (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), ",\"cl\":%u", info[i].cluster)); } if (!(flags & HB_BUFFER_SERIALIZE_FLAG_NO_POSITIONS)) @@ -161,21 +161,21 @@ _hb_buffer_serialize_glyphs_text (hb_buffer_t *buffer, p += strlen (p); } else - p += snprintf (p, ARRAY_LENGTH (b) - (p - b), "%u", info[i].codepoint); + p += MAX (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), "%u", info[i].codepoint)); if (!(flags & HB_BUFFER_SERIALIZE_FLAG_NO_CLUSTERS)) { - p += snprintf (p, ARRAY_LENGTH (b) - (p - b), "=%u", info[i].cluster); + p += MAX (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), "=%u", info[i].cluster)); } if (!(flags & HB_BUFFER_SERIALIZE_FLAG_NO_POSITIONS)) { if (pos[i].x_offset || pos[i].y_offset) - p += snprintf (p, ARRAY_LENGTH (b) - (p - b), "@%d,%d", pos[i].x_offset, pos[i].y_offset); + p += MAX (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), "@%d,%d", pos[i].x_offset, pos[i].y_offset)); *p++ = '+'; - p += snprintf (p, ARRAY_LENGTH (b) - (p - b), "%d", pos[i].x_advance); + p += MAX (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), "%d", pos[i].x_advance)); if (pos->y_advance) - p += snprintf (p, ARRAY_LENGTH (b) - (p - b), ",%d", pos[i].y_advance); + p += MAX (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), ",%d", pos[i].y_advance)); } if (buf_size > (p - b)) |