Revision: 48475
          http://brlcad.svn.sourceforge.net/brlcad/?rev=48475&view=rev
Author:   brlcad
Date:     2012-01-12 01:36:24 +0000 (Thu, 12 Jan 2012)
Log Message:
-----------
try a trivial quellage for coverity TAINTED_SCALAR issue.  given the unit test 
is not standalone, though, it could use some improvement love or get removed.  
(cid 1767)

Modified Paths:
--------------
    brlcad/trunk/src/libbu/test_htond.c

Modified: brlcad/trunk/src/libbu/test_htond.c
===================================================================
--- brlcad/trunk/src/libbu/test_htond.c 2012-01-12 01:26:46 UTC (rev 48474)
+++ brlcad/trunk/src/libbu/test_htond.c 2012-01-12 01:36:24 UTC (rev 48475)
@@ -115,10 +115,17 @@
            nbytes = 4;
            break;
     }
+
+    /* get some data from stdin */
     ret = fread(buf, 8, NUM, stdin);
     if (ret != 8)
-       perror("fwrite");
+       perror("fread");
 
+    /* trivial data sanity test */
+    if (buf[0] == '\0')
+       return 1;
+       
+
     for (i=0; i<NUM; i++) {
        ntohd((unsigned char *)&after[i], (unsigned char *)&buf[i*8], 1);       
/* incremental */
        /* Floating point compare */
@@ -141,7 +148,8 @@
        flpr(&buf[i*8]);
        printf("\n");
     }
-    exit(0);
+
+    return 0;
 }
 
 

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


------------------------------------------------------------------------------
RSA(R) Conference 2012
Mar 27 - Feb 2
Save $400 by Jan. 27
Register now!
http://p.sf.net/sfu/rsa-sfdev2dev2
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to