Revision: 41289
          http://brlcad.svn.sourceforge.net/brlcad/?rev=41289&view=rev
Author:   brlcad
Date:     2010-11-08 23:15:34 +0000 (Mon, 08 Nov 2010)

Log Message:
-----------
what's up with the fixed length array?  eliminate MAXARGS and make it dynamic

Modified Paths:
--------------
    brlcad/trunk/src/gtools/g_qa.c

Modified: brlcad/trunk/src/gtools/g_qa.c
===================================================================
--- brlcad/trunk/src/gtools/g_qa.c      2010-11-08 23:12:55 UTC (rev 41288)
+++ brlcad/trunk/src/gtools/g_qa.c      2010-11-08 23:15:34 UTC (rev 41289)
@@ -45,7 +45,7 @@
     int i, j;
     int db_index;
     char c;
-    const char *av[MAXARGS];
+    const char **av;
     struct ged *gedp;
 
     bu_opterr = 0;
@@ -86,6 +86,8 @@
        bu_exit(1, usage, argv[0]);
     }
 
+    av = (const char **)bu_calloc(argc, sizeof(char *), "av");
+
     db_index = bu_optind;
     for (i = j = 0; i < argc; ++i) {
        if (i == db_index)
@@ -97,6 +99,7 @@
     av[j] = (char *)0;
 
     if ((gedp = ged_open("db", argv[db_index], 1)) == GED_NULL) {
+       bu_free(av, "av");
        bu_exit(1, usage, argv[0]);
     }
 
@@ -107,6 +110,8 @@
        bu_log("%s", bu_vls_addr(&gedp->ged_result_str));
     ged_close(gedp);
 
+    bu_free(av, "av");
+
     return 0;
 }
 


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

------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a 
Billion" shares his insights and actions to help propel your 
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to