From 773cef4faeec7a9c76123aca861525dca7dfb6bf Mon Sep 17 00:00:00 2001 From: Marcel Raad Date: Wed, 21 Dec 2016 11:05:13 +0100 Subject: [PATCH] lib: fix MSVC compiler warnings Visual C++ complained: warning C4267: '=': conversion from 'size_t' to 'long', possible loss of data warning C4701: potentially uninitialized local variable 'path' used --- lib/http_digest.c | 2 +- lib/mprintf.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/http_digest.c b/lib/http_digest.c index 0ed02493d..e2d865b0a 100644 --- a/lib/http_digest.c +++ b/lib/http_digest.c @@ -74,7 +74,7 @@ CURLcode Curl_output_digest(struct connectdata *conn, { CURLcode result; struct Curl_easy *data = conn->data; - unsigned char *path; + unsigned char *path = NULL; char *tmp = NULL; char *response; size_t len; diff --git a/lib/mprintf.c b/lib/mprintf.c index 0dea5af62..e4270abe8 100644 --- a/lib/mprintf.c +++ b/lib/mprintf.c @@ -935,7 +935,7 @@ static int dprintf_formatf( } if(prec > (long)maxprec) - prec = maxprec-1; + prec = (long)maxprec-1; /* RECURSIVE USAGE */ len = curl_msnprintf(fptr, left, ".%ld", prec); fptr += len;