Perform inconsequential code cleanup

This commit is contained in:
Justine Tunney 2023-08-07 20:22:49 -07:00
parent 929478c524
commit decf216655
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
52 changed files with 326 additions and 442 deletions

View file

@ -22,7 +22,7 @@
#include "libc/dns/resolvconf.h"
#include "libc/dns/servicestxt.h"
#include "libc/fmt/conv.h"
#include "libc/intrin/safemacros.internal.h"
#include "libc/macros.internal.h"
#include "libc/mem/gc.h"
#include "libc/mem/mem.h"
#include "libc/sock/sock.h"
@ -94,7 +94,7 @@ int getaddrinfo(const char *name, const char *service,
return EAI_NONAME;
} else if (ResolveHostsTxt(GetHostsTxt(), AF_INET, name, ai->ai_addr,
sizeof(ai->ai_addr4), &canon) > 0) {
memcpy(ai->ai_canonname, canon, min(strlen(canon), DNS_NAME_MAX) + 1);
strlcpy(ai->ai_canonname, canon, DNS_NAME_MAX + 1);
*res = ai;
return 0;
} else {