Imported Upstream version 7.50.2
[platform/upstream/curl.git] / tests / libtest / lib553.c
index 96d5699..9afaad4 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2016, 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
@@ -39,7 +39,7 @@ static size_t myreadfunc(void *ptr, size_t size, size_t nmemb, void *stream)
   memset(buf, 'A', sizeof(buf));
 
   size *= nmemb;
-  if (size > total)
+  if(size > total)
     size = total;
 
   if(size > sizeof(buf))
@@ -73,18 +73,18 @@ int test(char *URL)
     return TEST_ERR_MAJOR_BAD;
   }
 
-  for (i = 0; i < NUM_HEADERS; i++) {
-    int len = sprintf(buf, "Header%d: ", i);
+  for(i = 0; i < NUM_HEADERS; i++) {
+    int len = snprintf(buf, sizeof(buf), "Header%d: ", i);
     memset(&buf[len], 'A', SIZE_HEADERS);
     buf[len + SIZE_HEADERS]=0; /* zero terminate */
     hl = curl_slist_append(headerlist,  buf);
-    if (!hl)
+    if(!hl)
       goto test_cleanup;
     headerlist = hl;
   }
 
   hl = curl_slist_append(headerlist, "Expect: ");
-  if (!hl)
+  if(!hl)
     goto test_cleanup;
   headerlist = hl;