]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Fixed gcc warning 887/head
authorAlexander Pevzner <pzz@apevzner.com>
Thu, 8 Feb 2024 08:49:02 +0000 (11:49 +0300)
committerAlexander Pevzner <pzz@apevzner.com>
Thu, 8 Feb 2024 15:56:27 +0000 (18:56 +0300)
In cups/dest.c:

    dest.c:1830:21: warning: ā€˜%s’ directive argument is null [-Wformat-overflow=]
     1733 |       DEBUG_printf(("1cupsGetNamedDest: Using name=\"%s\"...", name));
  |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This is really true, and gcc was smart enough to deduct it from context.
Obviously, we meant to print dest_name here.

cups/dest.c

index bb62adaf8f21dea1c20c502beabee34acc84f43d..8c27cb5e714bca2876c3070483cb506d6bba45c5 100644 (file)
@@ -1730,7 +1730,7 @@ cupsGetNamedDest(http_t     *http,        // I - Connection to server or @code CUPS_HTT
       DEBUG_puts("1cupsGetNamedDest: Asking server for default printer...");
     }
     else
-      DEBUG_printf("1cupsGetNamedDest: Using name=\"%s\"...", name);
+      DEBUG_printf("1cupsGetNamedDest: Using dest_name=\"%s\"...", dest_name);
   }
 
   //