about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--getservinfo.c3
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)++ = '.';
 	}