Revision: 57903
          http://sourceforge.net/p/brlcad/code/57903
Author:   tbrowder2
Date:     2013-09-26 14:15:40 +0000 (Thu, 26 Sep 2013)
Log Message:
-----------
make provision for a null user name

Modified Paths:
--------------
    brlcad/trunk/misc/CMake/test_srcs/report_username.c.in

Modified: brlcad/trunk/misc/CMake/test_srcs/report_username.c.in
===================================================================
--- brlcad/trunk/misc/CMake/test_srcs/report_username.c.in      2013-09-26 
10:48:05 UTC (rev 57902)
+++ brlcad/trunk/misc/CMake/test_srcs/report_username.c.in      2013-09-26 
14:15:40 UTC (rev 57903)
@@ -9,9 +9,12 @@
 #define chararraysize 2048
 int main(void) {
   FILE *outfp = NULL;
+  char *name = getenv(USERVAR);
   outfp = fopen("${BRLCAD_BINARY_DIR}/include/conf/USER.tmp", "w");
-  printf("user name: %s\n", getenv(USERVAR));
-  fprintf(outfp, "\"%s\"", getenv(USERVAR));
+  if (!name)
+    name = "unknown";
+  printf("user name: %s\n", name);
+  fprintf(outfp, "\"%s\"", name);
   fclose(outfp);
   return 0;
 }

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


------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk
_______________________________________________
BRL-CAD Source Commits mailing list
brlcad-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to