]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
example/cookie_interface: fix scan-build printf warning
authorDaniel Stenberg <daniel@haxx.se>
Mon, 26 Jul 2021 12:27:45 +0000 (14:27 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 26 Jul 2021 16:20:03 +0000 (18:20 +0200)
Follow-up to 4b79c4fb565

Fixes #7497
Closes #7498

docs/examples/cookie_interface.c

index fb2b9fb7ce7161eb6b417152b542bebc30d97b5d..fb76ae927de5bda2f30cc2ab9bcd24c6cb6b915d 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
  *
  * This software is licensed as described in the file COPYING, which
  * you should have received as part of this distribution. The terms
@@ -69,7 +69,7 @@ main(void)
   curl_global_init(CURL_GLOBAL_ALL);
   curl = curl_easy_init();
   if(curl) {
-    char nline[256];
+    char nline[512];
 
     curl_easy_setopt(curl, CURLOPT_URL, "https://www.example.com/");
     curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
@@ -93,7 +93,7 @@ main(void)
 #define snprintf _snprintf
 #endif
     /* Netscape format cookie */
-    snprintf(nline, sizeof(nline), "%s\t%s\t%s\t%s\t%.0lf\t%s\t%s",
+    snprintf(nline, sizeof(nline), "%s\t%s\t%s\t%s\t%.0f\t%s\t%s",
              ".example.com", "TRUE", "/", "FALSE",
              difftime(time(NULL) + 31337, (time_t)0),
              "PREF", "hello example, i like you very much!");