From 7fa76b06632628882ca214b4cf1fb4c2106f2c7b Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Fri, 16 Oct 2015 06:53:57 -0700 Subject: Most uses of auto_str should be static_str. These functions do exactly same thing, but communicate something different to the reader of the code. An auto_str is on the stack, and so must not be passed somewhere where it will be retained. * txr.c (help, compat, txr_main): Use static_str on version. --- txr.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/txr.c b/txr.c index 8b69d373..36937ffe 100644 --- a/txr.c +++ b/txr.c @@ -163,7 +163,7 @@ static void help(void) "are mutually exclusive; the right-most one dominates.\n" "\n" ); - format(std_output, text, auto_str(version), prog_string, nao); + format(std_output, text, static_str(version), prog_string, nao); } #if HAVE_TERMIOS @@ -369,7 +369,7 @@ static int compat(val optval) if (min) { format(std_error, lit("~a: compatibility with versions " "lower than ~a not supported by version ~a\n"), - prog_string, num(min), auto_str(version), nao); + prog_string, num(min), static_str(version), nao); return 0; } @@ -501,7 +501,7 @@ int txr_main(int argc, char **argv) if (equal(opt, lit("version"))) { format(std_output, lit("~a: version ~a\n"), - prog_string, auto_str(version), nao); + prog_string, static_str(version), nao); return 0; } -- cgit v1.2.3