-/*****************************************************************************
+/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
+ * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
*
- * This test case and code is based on the bug recipe Joe Malicki provided for
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at https://curl.haxx.se/docs/copyright.html.
+ *
+ * You may opt to use, copy, modify, merge, publish, distribute and/or sell
+ * copies of the Software, and permit persons to whom the Software is
+ * furnished to do so, under the terms of the COPYING file.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ***************************************************************************/
+
+/* This test case and code is based on the bug recipe Joe Malicki provided for
* bug report #1871269, fixed on Jan 14 2008 before the 7.18.0 release.
*/
memset(buf, 'A', sizeof(buf));
size *= nmemb;
- if (size > total)
+ if(size > total)
size = total;
if(size > sizeof(buf))
return TEST_ERR_MAJOR_BAD;
}
- if((curl = curl_easy_init()) == NULL) {
+ curl = curl_easy_init();
+ if(!curl) {
fprintf(stderr, "curl_easy_init() failed\n");
curl_global_cleanup();
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;