From 93f80836b4de9489a762ba138714721a70ec699e Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sat, 6 Jul 2019 17:54:56 +0100 Subject: [PATCH] cmdgen: add const on main() variable 'comment'. It's a secondary reference to existing data (namely an argv word, if anything at all), and never needs to be written through, so we should mark it const, if nothing else to catch any absent-minded attempts to free it. --- cmdgen.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmdgen.c b/cmdgen.c index 5f62c656..b675d94d 100644 --- a/cmdgen.c +++ b/cmdgen.c @@ -222,7 +222,8 @@ int main(int argc, char **argv) enum { PRIVATE, PUBLIC, PUBLICO, FP, OPENSSH_AUTO, OPENSSH_NEW, SSHCOM } outtype = PRIVATE; int bits = -1; - char *comment = NULL, *origcomment = NULL; + const char *comment = NULL; + char *origcomment = NULL; bool change_passphrase = false; bool errs = false, nogo = false; int intype = SSH_KEYTYPE_UNOPENABLE;