From 6cbfcdc85e3216a894b7b07b019a7592be1ad720 Mon Sep 17 00:00:00 2001 From: Mike Gelfand Date: Wed, 1 Jul 2015 00:58:00 +0000 Subject: [PATCH] Fix `tr_net_strerror` on Windows (oops) --- libtransmission/net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libtransmission/net.c b/libtransmission/net.c index 3d161a027..2894f6b42 100644 --- a/libtransmission/net.c +++ b/libtransmission/net.c @@ -75,7 +75,7 @@ tr_net_strerror (char * buf, size_t buflen, int err) { *buf = '\0'; #ifdef _WIN32 - FormatMessageA (FORMAT_MESSAGE_FROM_SYSTEM, NULL, err, 0, buf, buflen, NULL); + DWORD len = FormatMessageA (FORMAT_MESSAGE_FROM_SYSTEM, NULL, err, 0, buf, buflen, NULL); while (len > 0 && buf[len - 1] >= '\0' && buf[len - 1] <= ' ') buf[--len] = '\0'; #else