Index: /trunk/psLib/src/sys/psString.c
===================================================================
--- /trunk/psLib/src/sys/psString.c	(revision 630)
+++ /trunk/psLib/src/sys/psString.c	(revision 631)
@@ -8,6 +8,6 @@
  *  @author Eric Van Alst, MHPCC
  *   
- *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-04-28 22:20:22 $
+ *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-05-10 19:01:36 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -72,4 +72,6 @@
 )
 {
+    char *returnValue = NULL;
+
     // Check the number of characters to copy is non-negative
     if ( nChar < 0 ) {
@@ -82,5 +84,13 @@
     // Copy input string to memory allocated up to nChar characters
     // Return the copy
-    return strncpy(psAlloc((size_t)nChar + 1), str, (size_t)nChar);
+    returnValue = strncpy(psAlloc((size_t)nChar + 1), str, (size_t)nChar);
+
+    // Ensure the last byte is NULL character
+    if ( nChar > 0 ) {
+        returnValue[nChar-1] = NULL;
+    }
+
+    // Return the string pointer
+    return returnValue;
 }
 
Index: /trunk/psLib/src/sysUtils/psString.c
===================================================================
--- /trunk/psLib/src/sysUtils/psString.c	(revision 630)
+++ /trunk/psLib/src/sysUtils/psString.c	(revision 631)
@@ -8,6 +8,6 @@
  *  @author Eric Van Alst, MHPCC
  *   
- *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-04-28 22:20:22 $
+ *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-05-10 19:01:36 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -72,4 +72,6 @@
 )
 {
+    char *returnValue = NULL;
+
     // Check the number of characters to copy is non-negative
     if ( nChar < 0 ) {
@@ -82,5 +84,13 @@
     // Copy input string to memory allocated up to nChar characters
     // Return the copy
-    return strncpy(psAlloc((size_t)nChar + 1), str, (size_t)nChar);
+    returnValue = strncpy(psAlloc((size_t)nChar + 1), str, (size_t)nChar);
+
+    // Ensure the last byte is NULL character
+    if ( nChar > 0 ) {
+        returnValue[nChar-1] = NULL;
+    }
+
+    // Return the string pointer
+    return returnValue;
 }
 
