aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/server/getpart.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/server/getpart.c b/tests/server/getpart.c
index 3ecc20c99..6f893a8bc 100644
--- a/tests/server/getpart.c
+++ b/tests/server/getpart.c
@@ -27,8 +27,10 @@
#include "getpart.h"
-#define _MPRINTF_REPLACE /* use our functions only */
-#include <curl/mprintf.h>
+#define ENABLE_CURLX_PRINTF
+/* make the curlx header define all printf() functions to use the curlx_*
+ versions instead */
+#include "curlx.h" /* from the private lib dir */
/* just to please base64.h we create a fake struct */
struct SessionHandle {
@@ -97,7 +99,9 @@ static int readline(char **buffer, size_t *bufsize, FILE *stream)
}
for(;;) {
- if(!fgets(*buffer + offset, (int)(*bufsize - offset), stream))
+ int bytestoread = curlx_uztosi(*bufsize - offset);
+
+ if(!fgets(*buffer + offset, bytestoread, stream))
return (offset != 0) ? GPE_OK : GPE_END_OF_FILE ;
length = offset + strlen(*buffer + offset);