[gimp] Don't need to use snprintf() in atom2str to return some fixed strings. From SVN version 102 of offic



commit 5bacf11360350bdf8e4a46d4d0ec45e535f54863
Author: Kevin Cozens <kevin ve3syb ca>
Date:   Sun Aug 17 18:16:53 2014 -0400

    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 files changed, 6 insertions(+), 7 deletions(-)
---
diff --git a/plug-ins/script-fu/tinyscheme/scheme.c b/plug-ins/script-fu/tinyscheme/scheme.c
index f14de9d..f0c1380 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 = "#<EOF>";
      } else if (is_port(l)) {
-          p = sc->strbuff;
-          snprintf(p, STRBUFFSIZE, "#<PORT>");
+          p = "#<PORT>";
      } 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]);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]