[PATCH v2] ws2_32: Base inet_addr() implementation on musl.

Paul Gofman pgofman at codeweavers.com
Fri Mar 4 13:35:32 CST 2022


On 3/4/22 22:33, Zebediah Figura wrote:
> On 3/3/22 04:32, Paul Gofman wrote:
>>            - allow any space as terminator and add tests for that;
>
> Somehow the tests didn't seem to make it into this patch.
>
Eh... I added the whole loop for that which tests all the possible 
characters in the end of the string?

+    }
+
+    strcpy(str, "1.2.3");
+    str[6] = 0;
+    for (i = 1; i < 256; ++i)
+    {
+        if (isdigit(i))
+            continue;
+        str[5] = i;
+        expected = isspace(i) ? 0x03000201 : 0xffffffff;
+        addr = inet_addr(str);
+        ok(addr == expected, "got addr %#08x, expected %#08x, i %u\n", addr, expected, i);
+    }
+}
+




More information about the wine-devel mailing list