gcl-devel
[Top][All Lists]
Advanced

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

[Gcl-devel] TCL_signal_error bug


From: Jerry James
Subject: [Gcl-devel] TCL_signal_error bug
Date: Mon, 26 Aug 2013 15:04:16 -0600

I happened to spot a gcc warning when building the latest GCL release
(thanks, Camm!) for Fedora.  The function TCL_signal_error() in
gcl/gcl-tk/tkMain.c has an sprintf call that omits the buffer it is
supposed to be printing into.  I think this patch is appropriate:

diff --git a/gcl/gcl-tk/tkMain.c b/gcl/gcl-tk/tkMain.c
index 9b1ee37..39a12e1 100755
--- a/gcl/gcl-tk/tkMain.c
+++ b/gcl/gcl-tk/tkMain.c
@@ -191,7 +191,7 @@ static void
 TCL_signal_error(x)
      char *x;
 {char buf[300] ;
- sprintf("error %s",x);
+ snprintf(buf,300,"error %s",x);
  Tcl_Eval(interp,buf);
  dfprintf(stderr,x);
 }

Regards,
-- 
Jerry James
http://www.jamezone.org/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]