changeset 4428:27de5fd1012a draft

options: terminate strings that are not quoted
author Roy Marples <roy@marples.name>
date Wed, 10 Apr 2019 22:58:36 +0100
parents 960c888a8c4f
children 85da28e7b6e7
files src/if-options.c
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/if-options.c	Wed Apr 10 22:33:01 2019 +0100
+++ b/src/if-options.c	Wed Apr 10 22:58:36 2019 +0100
@@ -388,9 +388,11 @@
 	}
 	if (punt_last) {
 		if (sbuf)
-			*--sbuf = '\0';
+			--sbuf;
 		l--;
 	}
+	if (sbuf)
+		*sbuf = '\0';
 	return (ssize_t)l;
 }