]> git.eshelyaron.com Git - emacs.git/commitdiff
Stifle a compiler warning under GCC 13
authorPo Lu <luangruo@yahoo.com>
Thu, 24 Aug 2023 05:13:23 +0000 (05:13 +0000)
committerPo Lu <luangruo@yahoo.com>
Thu, 24 Aug 2023 05:13:23 +0000 (05:13 +0000)
* src/haiku_support.cc (MessageReceived): Shun snprintf, as GCC
produces false positives cautioning against truncation.

src/haiku_support.cc

index d5649e4d2ce4317ad32f79bd96ffe5c345aede92..12a84687180208c5fef9c91a4956e1e59f15a9f7 100644 (file)
@@ -3315,9 +3315,7 @@ class EmacsFilePanelCallbackLooper : public BLooper
              {
                str_buf = (char *) alloca (std::strlen (str_path)
                                           + std::strlen (name) + 2);
-               snprintf (str_buf, std::strlen (str_path)
-                         + std::strlen (name) + 2, "%s/%s",
-                         str_path, name);
+               sprintf (str_buf, "%s/%s", str_path, name);
                file_name = strdup (str_buf);
              }
          }