]> Savannah Git Hosting - gnulib.git/commitdiff
uniname/uniname: Improve comments.
authorBruno Haible <bruno@clisp.org>
Sun, 4 Jun 2023 08:45:00 +0000 (10:45 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 4 Jun 2023 08:45:00 +0000 (10:45 +0200)
* lib/uniname/uniname.c (unicode_character_name): Fix comments.

ChangeLog
lib/uniname/uniname.c

index 5c1d3a1edf81816f79b1a0304fa4eb6a815badb2..959b18d3964fe423c581959a30866808cf73756d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2023-06-04  Bruno Haible  <bruno@clisp.org>
+
+       uniname/uniname: Improve comments.
+       * lib/uniname/uniname.c (unicode_character_name): Fix comments.
+
 2023-06-03  Bruno Haible  <bruno@clisp.org>
 
        classpath, csharpexec: Avoid "candidate for attribute 'malloc'" warning.
index 99b303a3d0ae1908de20da1b1936d48462187586..f6ef6956e88b297b022db1703d086a1429dd5c6f 100644 (file)
@@ -245,7 +245,7 @@ unicode_character_name (ucs4_t c, char *buf)
       unsigned int index3;
       const char *q;
 
-      /* buf needs to have at least 16 + 7 bytes here.  */
+      /* buf needs to have at least 16 + 7 + 1 bytes here.  */
       memcpy (buf, "HANGUL SYLLABLE ", 16);
       ptr = buf + 16;
 
@@ -274,7 +274,7 @@ unicode_character_name (ucs4_t c, char *buf)
       char *ptr;
       int i;
 
-      /* buf needs to have at least 28 + 5 bytes here.  */
+      /* buf needs to have at least 28 + 5 + 1 bytes here.  */
       memcpy (buf, "CJK COMPATIBILITY IDEOGRAPH-", 28);
       ptr = buf + 28;
 
@@ -291,7 +291,7 @@ unicode_character_name (ucs4_t c, char *buf)
       /* Special case for variation selectors. Keeps the tables
          small.  */
 
-      /* buf needs to have at least 19 + 3 bytes here.  */
+      /* buf needs to have at least 19 + 3 + 1 bytes here.  */
       sprintf (buf, "VARIATION SELECTOR-%d",
                c <= 0xFE0F ? c - 0xFE00 + 1 : c - 0xE0100 + 17);
       return buf;
@@ -339,7 +339,8 @@ unicode_character_name (ucs4_t c, char *buf)
       if (words != NULL)
         {
           /* Found it in unicode_index_to_name. Now concatenate the words.  */
-          /* buf needs to have at least UNICODE_CHARNAME_MAX_LENGTH bytes.  */
+          /* buf needs to have at least UNICODE_CHARNAME_MAX_LENGTH + 1
+             bytes.  */
           char *ptr = buf;
           for (;;)
             {