]> diplodocus.org Git - nmh/blobdiff - sbr/charstring.c
Display the command when reporting timing.
[nmh] / sbr / charstring.c
index 00c6598652d8fe2ebef6f662be20fc98ec8bccd2..589b000ec2e5b6df7617985e6afef35c52768f1f 100644 (file)
@@ -1,5 +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
  *               in both characters and bytes
  *
  * This code is Copyright (c) 2014, by the authors of nmh.  See the
@@ -181,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);
         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; }
     }
 #else  /* ! MULTIBYTE_SUPPORT */
     if (charstring_bytes (s) > 0) { len = 1; }