From 3281e44e84e6b3b2030fdebe10dcf95f10565846 Mon Sep 17 00:00:00 2001 From: unknown-v <52547845+unknown-v@users.noreply.github.com> Date: Sat, 13 Jul 2019 06:14:54 +0200 Subject: [PATCH] http_win : fix buf length Line 157 : buf[nr_read] = 0 set the null character '\0' --- vlib/http/http_win.v | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vlib/http/http_win.v b/vlib/http/http_win.v index 9141cf1eaa..f4ac2bf200 100644 --- a/vlib/http/http_win.v +++ b/vlib/http/http_win.v @@ -107,9 +107,9 @@ fn (req &Request) do() Response { } // println('LEN BEFORE SEND=$headers.len ; $headers') # bool ret =HttpSendRequest(request, headers.str, -1, data.str, data.len); - # printf("RET=%d\n", ret); - # int e = GetLastError(); - # printf("e=%d\n", e); + // # printf("RET=%d\n", ret); + // # int e = GetLastError(); + // # printf("e=%d\n", e); // Get response headers // Todo call twice to get len # LPSTR h_buf = malloc(1024); @@ -157,7 +157,7 @@ fn (req &Request) do() Response { buf[nr_read] = 0 //C.printf('buf="%s"\n', buf) - s += tos(buf, nr_read + 1) // TODO perf + s += tos(buf, nr_read) // TODO perf nr_read = 0 } C.InternetCloseHandle(request)