Index: trunk/psLib/src/sys/psLogMsg.c
===================================================================
--- trunk/psLib/src/sys/psLogMsg.c	(revision 7587)
+++ trunk/psLib/src/sys/psLogMsg.c	(revision 7588)
@@ -11,6 +11,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.56 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-06-16 23:01:10 $
+ *  @version $Revision: 1.57 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-06-17 01:19:39 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -344,9 +344,10 @@
         // detect multiple lines in message and indent each line by 4 spaces.
         char *line = strtok_r(msg, "\n", &msgPtr);
-        do {
+        while (line) {
             write(logFD, "    ", 4);
             write(logFD, line, strlen(line));
             write(logFD, "\n", 1);
-        } while ((line = strtok_r(NULL, "\n", &msgPtr)));
+            line = strtok_r(NULL, "\n", &msgPtr);
+        }
     } else {
         write(logFD, "\n", 1);
