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
1 changed files with 1 additions and 1 deletions

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