Index: trunk/psLib/src/sys/psString.c
===================================================================
--- trunk/psLib/src/sys/psString.c	(revision 440)
+++ trunk/psLib/src/sys/psString.c	(revision 531)
@@ -8,6 +8,6 @@
  *  @author Eric Van Alst, MHPCC
  *   
- *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-04-19 19:10:26 $
+ *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-04-27 22:39:48 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -21,4 +21,5 @@
 #include "psString.h"
 #include "psMemory.h"
+#include "psError.h"
 
 /******************************************************************************/
@@ -71,4 +72,11 @@
 )
 {
+    // Check the number of characters to copy is non-negative
+    if ( nChar < 0 ) {
+        // Log error message and return NULL
+        psError(__FILE__,"psStringNCopy with negative count specified %d",
+                nChar);
+        return NULL;
+    }
     // Allocate memory using psAlloc function - nChar bytes
     // Copy input string to memory allocated up to nChar characters
@@ -77,2 +85,3 @@
 }
 
+
