From 79d2ef0fbe125b713f34bc091d526920ee0fd903 Mon Sep 17 00:00:00 2001
From: Miller Puckette <msp@ucsd.edu>
Date: Thu, 31 Jan 2008 13:54:40 -0800
Subject: [PATCH] got sprintf out from between fork and exec in t_tkcmd.c

---
 src/notes.txt | 1 +
 src/t_tkcmd.c | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/notes.txt b/src/notes.txt
index 168bd1840..ea8ed631d 100644
--- a/src/notes.txt
+++ b/src/notes.txt
@@ -13,6 +13,7 @@ mac:
 Gnome: why don't windows pop up when clicked on?
 
 problems:
+find asdf$1 (e.g.) doesn't work
 check real-time gaps in writesf~
 fix declare to update current patch when changed
 objects on GOP don't erase if you edit the GOP while they're showing
diff --git a/src/t_tkcmd.c b/src/t_tkcmd.c
index c32dc346b..bd6ff5a5d 100644
--- a/src/t_tkcmd.c
+++ b/src/t_tkcmd.c
@@ -420,6 +420,7 @@ static void pd_startfromgui( void)
 #endif
 
 #ifdef UNISTD
+    sprintf(cmdbuf, "\"%s\" -guiport %d\n", pdbuf, portno);
     childpid = fork();
     if (childpid < 0)
     {
@@ -429,7 +430,6 @@ static void pd_startfromgui( void)
     }
     else if (!childpid)                 /* we're the child */
     {
-        sprintf(cmdbuf, "\"%s\" -guiport %d\n", pdbuf, portno);
 #ifdef DEBUGCONNECT     
         fprintf(debugfd, "%s", cmdbuf);
         fflush(debugfd);
-- 
GitLab