commit - b736ca35f220381799b62c731710c8d593dcd296
commit + 0cd6675437e580ae2ac585d6b0bff325990cf8b8
blob - 5fa68122b51bed663359aa6099dec26af3a41def
blob + 304db7a56560d97db8d2cfe8d760332fd7f46b6e
--- puny.c
+++ puny.c
copy_until_delimiter(const char *s, char *out, size_t len)
{
char *end, *t;
+ size_t l;
end = strchr(s, '\0');
- if (end - s > len)
+ l = end - s;
+ if (l > len)
return NULL;
for (t = end; t >= s; --t)
insert(char *out, size_t len, int codepoint, size_t i)
{
int l;
- size_t outlen;
char *t;
if (codepoint <= 0x7F)
return 1;
}
-const char *
+static const char *
end_of_component(const char *hostname)
{
for (; *hostname != '\0' && *hostname != '.'; ++hostname)
s = hostname;
for (;;) {
end = end_of_component(s);
- if (end - s >= sizeof(comp))
+ l = end - s;
+ if (l >= sizeof(comp))
return 0;
memcpy(comp, s, end - s);