summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
Diffstat (limited to 'desktop')
-rw-r--r--desktop/options.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/desktop/options.c b/desktop/options.c
index 091a3b9e5..3ead9be11 100644
--- a/desktop/options.c
+++ b/desktop/options.c
@@ -633,6 +633,10 @@ int options_snoptionf(char *string, size_t size, unsigned int option,
fmtc++;
}
}
+
+ /* Ensure that we NUL-terminate the output */
+ string[min(slen, size - 1)] = '\0';
+
return slen;
}