diff options
author | Omar Polo <op@omarpolo.com> | 2021-01-27 11:21:23 +0000 |
---|---|---|
committer | Omar Polo <op@omarpolo.com> | 2021-01-27 11:21:23 +0000 |
commit | 7957cbd9aad6ace179287b2ddcbae0b14a25a90d (patch) | |
tree | 1c1ee41b84dc98afd5090e8bc362498298140801 /regress | |
parent | 42650adec078a7d3e885afbafa1fa4406d4823fb (diff) |
const-ify puny_decode (and add puny.c)
Diffstat (limited to 'regress')
-rw-r--r-- | regress/puny-test.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/regress/puny-test.c b/regress/puny-test.c index b25f82a..26d6571 100644 --- a/regress/puny-test.c +++ b/regress/puny-test.c @@ -48,16 +48,12 @@ main(int argc, char **argv) { struct suite *i; int failed; - char *hostname; char buf[64]; /* name len */ failed = 0; for (i = t; i->src != NULL; ++i) { - if ((hostname = strdup(i->src)) == NULL) - return 0; - memset(buf, 0, sizeof(buf)); - if (!puny_decode(hostname, buf, sizeof(buf))) { + if (!puny_decode(i->src, buf, sizeof(buf))) { printf("decode: failure with %s\n", i->src); failed = 1; continue; @@ -70,8 +66,6 @@ main(int argc, char **argv) continue; } else printf("OK: %s => %s\n", i->src, buf); - - free(hostname); } return failed; |