X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/177f020f122827214159c46dcfe7ded1e3c8d1c3..62266c4be53416747bc25ee24578ae7b811ce6db:/sbr/charstring.c?ds=sidebyside diff --git a/sbr/charstring.c b/sbr/charstring.c index eefca7de..589b000e 100644 --- a/sbr/charstring.c +++ b/sbr/charstring.c @@ -1,4 +1,4 @@ -/* charstring -- dynamically-sized char array that can report size +/* charstring.c -- dynamically-sized char array that can report size * in both characters and bytes * * This code is Copyright (c) 2014, by the authors of nmh. See the @@ -180,8 +180,8 @@ charstring_last_char_len (const charstring_t s) { len = mbtowc (&wide_char, sp, (size_t) MB_CUR_MAX < remaining ? (size_t) MB_CUR_MAX : remaining); - sp += len > 0 ? len : 1; - remaining -= len > 0 ? len : 1; + sp += max(len, 1); + remaining -= max(len, 1); } #else /* ! MULTIBYTE_SUPPORT */ if (charstring_bytes (s) > 0) { len = 1; }