X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=windows%2Fwinnet.c;h=fa2de80967565e91cd7161512fd2646f7d563bfc;hb=1de7240eb88fa24a8532ded116b4ec72dd213008;hp=680de2a756338b4fe8ccc429033f69fb100e49d8;hpb=9e20c81bc9c945565dd182854eeffa03b63f830a;p=PuTTY.git diff --git a/windows/winnet.c b/windows/winnet.c index 680de2a7..fa2de809 100644 --- a/windows/winnet.c +++ b/windows/winnet.c @@ -138,7 +138,7 @@ static int cmpfortree(void *av, void *bv) static int cmpforsearch(void *av, void *bv) { Actual_Socket b = (Actual_Socket) bv; - unsigned long as = (unsigned long) av, bs = (unsigned long) b->s; + uintptr_t as = (uintptr_t) av, bs = (uintptr_t) b->s; if (as < bs) return -1; if (as > bs) @@ -478,8 +478,8 @@ const char *winsock_error_string(int error) MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), es->text + bufused, bufsize - bufused, NULL)) { sprintf(es->text + bufused, - "Windows error code %d (and FormatMessage returned %d)", - error, GetLastError()); + "Windows error code %d (and FormatMessage returned %u)", + error, (unsigned int)GetLastError()); } else { int len = strlen(es->text); if (len > 0 && es->text[len-1] == '\n') @@ -1658,7 +1658,7 @@ int select_result(WPARAM wParam, LPARAM lParam) ret = p_recv(s->s, buf, sizeof(buf), MSG_OOB); noise_ultralight(ret); if (ret <= 0) { - char *str = (ret == 0 ? "Internal networking trouble" : + const char *str = (ret == 0 ? "Internal networking trouble" : winsock_error_string(p_WSAGetLastError())); /* We're inside the Windows frontend here, so we know * that the frontend handle is unnecessary. */