Revision: 43877
          http://brlcad.svn.sourceforge.net/brlcad/?rev=43877&view=rev
Author:   bob1961
Date:     2011-03-16 18:23:33 +0000 (Wed, 16 Mar 2011)

Log Message:
-----------
Fixed a Windows related bug in _ged_run_rt (i.e. no longer using a fixed size 
char array to hold the command for CreateProcess.

Modified Paths:
--------------
    brlcad/trunk/src/libged/rt.c

Modified: brlcad/trunk/src/libged/rt.c
===================================================================
--- brlcad/trunk/src/libged/rt.c        2011-03-16 18:07:59 UTC (rev 43876)
+++ brlcad/trunk/src/libged/rt.c        2011-03-16 18:23:33 UTC (rev 43877)
@@ -162,8 +162,7 @@
     STARTUPINFO si = {0};
     PROCESS_INFORMATION pi = {0};
     SECURITY_ATTRIBUTES sa = {0};
-    char line[2048];
-    char name[256];
+    struct bu_vls line;
 #endif
     vect_t eye_model;
     struct ged_run_rt *run_rtp;
@@ -271,15 +270,15 @@
     si.hStdOutput  = pipe_err[1];
     si.hStdError   = pipe_err[1];
 
-    snprintf(line, sizeof(line), "%s ", gedp->ged_gdp->gd_rt_cmd[0]);
-    for (i=1; i<gedp->ged_gdp->gd_rt_cmd_len; i++) {
-       snprintf(name, sizeof(name), "%s ", gedp->ged_gdp->gd_rt_cmd[i]);
-       bu_strlcat(line, name, sizeof(line));
+    bu_vls_init(&line);
+    for (i=0; i<gedp->ged_gdp->gd_rt_cmd_len; i++) {
+       bu_vls_printf(&line, "%s ", gedp->ged_gdp->gd_rt_cmd[i]);
     }
 
-    CreateProcess(NULL, line, NULL, NULL, TRUE,
+    CreateProcess(NULL, bu_vls_addr(&line), NULL, NULL, TRUE,
                  DETACHED_PROCESS, NULL, NULL,
                  &si, &pi);
+    bu_vls_free(&line);
 
     CloseHandle(pipe_in[0]);
     CloseHandle(pipe_err[1]);


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
BRL-CAD Source Commits mailing list
brlcad-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to