]> git.ozlabs.org Git - ccan/blobdiff - ccan/opt/helpers.c
various: add LICENSE comments.
[ccan] / ccan / opt / helpers.c
index e96f5db81ebf9df3c9af2d646875aa944b1d21ff..9c181946d6122122c2d89cf3b137129b4bd2f1d9 100644 (file)
@@ -1,3 +1,4 @@
+/* Licensed under GPLv3+ - see LICENSE file for details */
 #include <ccan/opt/opt.h>
 #include <string.h>
 #include <stdlib.h>
@@ -147,6 +148,8 @@ void opt_show_charp(char buf[OPT_SHOW_LEN], char *const *p)
                len = OPT_SHOW_LEN - 2;
        strncpy(buf+1, *p, len);
        buf[1+len] = '"';
+       if (len < OPT_SHOW_LEN - 2)
+               buf[2+len] = '\0';
 }
 
 /* Set an integer value, various forms.  Sets to 1 on arg == NULL. */