From d9c1fc339a0a9492ad6c2b83c20f36dfbbbf8e7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Gouget?= <fgouget@codeweavers.com> Date: Mon, 4 Feb 2002 18:36:42 +0000 Subject: [PATCH] Storing an IP address in a signed int results in bugs if it starts with >=128. --- dlls/comctl32/ipaddress.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dlls/comctl32/ipaddress.c b/dlls/comctl32/ipaddress.c index 0df1a2c1c6e..1d9616c84cd 100644 --- a/dlls/comctl32/ipaddress.c +++ b/dlls/comctl32/ipaddress.c @@ -347,7 +347,8 @@ IPADDRESS_SetAddress (HWND hwnd, WPARAM wParam, LPARAM lParam) HDC hdc; LPIP_SUBCLASS_INFO lpipsi=(LPIP_SUBCLASS_INFO) GetPropA ((HWND)hwnd, IP_SUBCLASS_PROP); - int i,ip_address,value; + int i,value; + DWORD ip_address; char buf[20]; TRACE("\n"); @@ -361,7 +362,7 @@ IPADDRESS_SetAddress (HWND hwnd, WPARAM wParam, LPARAM lParam) SetWindowTextA (lpipsi->hwndIP[i],buf); IPADDRESS_SendNotify (hwnd, EN_CHANGE); } - ip_address/=256; + ip_address= ip_address >> 8; } hdc = GetDC (hwnd); /* & send notifications */ -- GitLab