diff options
author | June McEnroe <june@causal.agency> | 2020-12-07 13:43:46 -0500 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2020-12-07 13:43:46 -0500 |
commit | 3ab4752c5685a2612135e4c34c9cbdffc1eb3038 (patch) | |
tree | 286f269ca902ce15117fac4afd1561a6aeff2679 | |
parent | Remove use of AI_DEFAULT (diff) | |
download | bubger-3ab4752c5685a2612135e4c34c9cbdffc1eb3038.tar.gz bubger-3ab4752c5685a2612135e4c34c9cbdffc1eb3038.zip |
Correctly handle . in nameString
-rw-r--r-- | getservinfo.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/getservinfo.c b/getservinfo.c index 0db7bc0..7565ef1 100644 --- a/getservinfo.c +++ b/getservinfo.c @@ -57,7 +57,8 @@ static void nameSkip(uint8_t **ptr) { } static char *nameString(uint8_t **ptr) { - char *name = (char *)(*ptr + 1); + char *name = (char *)*ptr; + if (**ptr) name++; for (uint8_t len; (len = **ptr); *ptr += len) { *(*ptr)++ = '.'; } |