]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Silence "may write a terminating nul past the end of the destination" warnings.
authorBruno Haible <bruno@clisp.org>
Fri, 2 Jun 2023 23:30:00 +0000 (01:30 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 4 Jun 2023 13:54:10 +0000 (15:54 +0200)
* gettext-tools/src/write-po.c (message_print_comment_filepos): Increase size of
buffer by 1.
* gettext-tools/src/xg-encoding.c (non_ascii_error_message,
non_utf8_error_message): Likewise.
* gettext-tools/src/xg-message.c (set_format_flags_from_context,
warn_format_string, remember_a_message): Likewise.

gettext-tools/src/write-po.c
gettext-tools/src/xg-encoding.c
gettext-tools/src/xg-message.c

index 1f1742cd971cf5c71706d388e329325d95826194..0c9623ffbef7f110e1ef25e1f8c77e92407630a9 100644 (file)
@@ -385,7 +385,7 @@ message_print_comment_filepos (const message_ty *mp, ostream_t stream,
           for (j = 0; j < filepos_count; ++j)
             {
               lex_pos_ty *pp;
-              char buffer[21];
+              char buffer[22];
               const char *cp;
               size_t width;
 
index a8b6fd2f0114185a2f4418a8fedcb1338732b96b..714a4922a73b69155d1a024ef60fdbdb680e318c 100644 (file)
@@ -62,7 +62,7 @@ char *
 non_ascii_error_message (lexical_context_ty lcontext,
                          const char *file_name, size_t line_number)
 {
-  char buffer[21];
+  char buffer[22];
   char *errmsg;
 
   if (line_number == (size_t)(-1))
@@ -102,7 +102,7 @@ static char *
 non_utf8_error_message (lexical_context_ty lcontext,
                         const char *file_name, size_t line_number)
 {
-  char buffer[21];
+  char buffer[22];
   char *errmsg;
 
   if (line_number == (size_t)(-1))
index 7b053798ce8d980442b500b9b592d6b1d2292769..818b8675f4120a80770aaa45cc7703caa125c620 100644 (file)
@@ -1,5 +1,5 @@
 /* Extracting a message.  Accumulating the message list.
-   Copyright (C) 2001-2020 Free Software Foundation, Inc.
+   Copyright (C) 2001-2020, 2023 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -81,7 +81,7 @@ set_format_flags_from_context (enum is_format is_format[NFORMATS],
                 /* The string is not a valid format string.  */
                 if (is_format[i] != possible)
                   {
-                    char buffer[21];
+                    char buffer[22];
 
                     error_with_progname = false;
                     if (pos->line_number == (size_t)(-1))
@@ -217,7 +217,7 @@ warn_format_string (enum is_format is_format[NFORMATS], const char *string,
   if (possible_format_p (is_format[format_python])
       && get_python_format_unnamed_arg_count (string) > 1)
     {
-      char buffer[21];
+      char buffer[22];
 
       error_with_progname = false;
       if (pos->line_number == (size_t)(-1))
@@ -286,7 +286,7 @@ remember_a_message (message_list_ty *mlp, char *msgctxt, char *msgid,
 
   if (msgctxt == NULL && msgid[0] == '\0' && !xgettext_omit_header)
     {
-      char buffer[21];
+      char buffer[22];
 
       error_with_progname = false;
       if (pos->line_number == (size_t)(-1))
@@ -310,8 +310,8 @@ meta information, not the empty string.\n")));
         {
           lex_pos_ty pos1;
           lex_pos_ty pos2;
-          char buffer1[21];
-          char buffer2[21];
+          char buffer1[22];
+          char buffer2[22];
 
           if (pluralp)
             {