1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-23 08:13:27 +00:00

Fix tr_net_strerror on Windows (oops)

This commit is contained in:
Mike Gelfand 2015-07-01 00:58:00 +00:00
parent 79195614b2
commit 6cbfcdc85e

View file

@ -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