diff -r -U2 gcl.orig/gcl-tk/tkMain.c gcl/gcl-tk/tkMain.c --- gcl.orig/gcl-tk/tkMain.c 2013-11-11 21:55:48.000000000 +0700 +++ gcl/gcl-tk/tkMain.c 2014-02-05 00:09:38.821981358 +0700 @@ -122,5 +122,5 @@ char *x; {char buf[300] ; - sprintf("error %s",x); + snprintf(buf,300,"error %s",x); Tcl_Eval(interp,buf); dfprintf(stderr,x); @@ -207,5 +207,5 @@ if (Tk_ParseArgv(interp, (Tk_Window) NULL, &argc, (const char **)argv, argTable, 0) != TCL_OK) { - fprintf(stderr, "%s\n", interp->result); + fprintf(stderr, "%s\n", Tcl_GetStringResult(interp)); exit(1); } @@ -291,5 +291,5 @@ if (Tcl_AppInit(interp) != TCL_OK) { - fprintf(stderr, "Tcl_AppInit failed: %s\n", interp->result); + fprintf(stderr, "Tcl_AppInit failed: %s\n", Tcl_GetStringResult(interp)); } @@ -301,5 +301,5 @@ code = Tcl_VarEval(interp, "wm geometry . ", geometry, (char *) NULL); if (code != TCL_OK) { - fprintf(stderr, "%s\n", interp->result); + fprintf(stderr, "%s\n", Tcl_GetStringResult(interp)); } } @@ -331,5 +331,5 @@ fullName = Tcl_TildeSubst(interp, tcl_RcFileName, &buffer); if (fullName == NULL) { - fprintf(stderr, "%s\n", interp->result); + fprintf(stderr, "%s\n", Tcl_GetStringResult(interp)); } else { f = fopen(fullName, "r"); @@ -337,5 +337,5 @@ code = Tcl_EvalFile(interp, fullName); if (code != TCL_OK) { - fprintf(stderr, "%s\n", interp->result); + fprintf(stderr, "%s\n", Tcl_GetStringResult(interp)); } fclose(f); @@ -372,5 +372,5 @@ msg = Tcl_GetVar(interp, "errorInfo", TCL_GLOBAL_ONLY); if (msg == NULL) { - msg = interp->result; + msg = Tcl_GetStringResult(interp); } dfprintf(stderr, "%s\n", msg); @@ -497,12 +497,11 @@ { char buf[4]; - char *p = buf; + char *p = buf, *string; /*header */ *p++ = (code ? '1' : '0'); bcopy(msg->msg_id,p,3); /* end header */ - if(sock_write_str2(dsfd, m_reply, buf, 4 , - interp->result, strlen(interp->result)) - < 0) + string = Tcl_GetStringResult(interp); + if(sock_write_str2(dsfd, m_reply, buf, 4, string, strlen(string)) < 0) { /* what do we want to do if the write failed */}