1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 22:57:44 +00:00

LibC: inet_pton() should return 1 on success, 0 or -1 on failure.

This commit is contained in:
Andreas Kling 2019-06-06 05:25:18 +02:00
parent d080f6e8dd
commit d03505bc29
3 changed files with 7 additions and 3 deletions

View file

@ -33,6 +33,10 @@ int main(int argc, char** argv)
dst_addr.sin_family = AF_INET;
dst_addr.sin_port = htons(8080);
rc = inet_pton(AF_INET, addr_str, &dst_addr.sin_addr);
if (rc <= 0) {
perror("inet_pton");
return 1;
}
char buffer[BUFSIZ];
const char* msg = "Test message";