From 5bacf11360350bdf8e4a46d4d0ec45e535f54863 Mon Sep 17 00:00:00 2001 From: Kevin Cozens Date: Sun, 17 Aug 2014 18:16:53 -0400 Subject: [PATCH] Don't need to use snprintf() in atom2str to return some fixed strings. From SVN version 102 of offical version of TinyScheme. --- plug-ins/script-fu/tinyscheme/scheme.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/plug-ins/script-fu/tinyscheme/scheme.c b/plug-ins/script-fu/tinyscheme/scheme.c index f14de9dcd4..f0c13801b7 100644 --- a/plug-ins/script-fu/tinyscheme/scheme.c +++ b/plug-ins/script-fu/tinyscheme/scheme.c @@ -2123,8 +2123,7 @@ static void atom2str(scheme *sc, pointer l, int f, char **pp, int *plen) { } else if (l == sc->EOF_OBJ) { p = "#"; } else if (is_port(l)) { - p = sc->strbuff; - snprintf(p, STRBUFFSIZE, "#"); + p = "#"; } else if (is_number(l)) { p = sc->strbuff; if (f <= 1 || f == 10) /* f is the base for numbers if > 1 */ { @@ -2179,17 +2178,17 @@ static void atom2str(scheme *sc, pointer l, int f, char **pp, int *plen) { } else { switch(c) { case ' ': - snprintf(p,STRBUFFSIZE,"#\\space"); break; + p = "#\\space"; case '\n': - snprintf(p,STRBUFFSIZE,"#\\newline"); break; + p = "#\\newline"; case '\r': - snprintf(p,STRBUFFSIZE,"#\\return"); break; + p = "#\\return"; case '\t': - snprintf(p,STRBUFFSIZE,"#\\tab"); break; + p = "#\\tab"; default: #if USE_ASCII_NAMES if(c==127) { - snprintf(p,STRBUFFSIZE, "#\\del"); + p = "#\\del"; break; } else if(c<32) { snprintf(p,STRBUFFSIZE, "#\\%s", charnames[c]);