[sword-svn] r2022 - trunk/src/utilfuns

dglassey at www.crosswire.org dglassey at www.crosswire.org
Fri Dec 8 09:00:32 MST 2006


Author: dglassey
Date: 2006-12-08 09:00:32 -0700 (Fri, 08 Dec 2006)
New Revision: 2022

Modified:
   trunk/src/utilfuns/swbuf.cpp
Log:
check max before *str in case max=0


Modified: trunk/src/utilfuns/swbuf.cpp
===================================================================
--- trunk/src/utilfuns/swbuf.cpp	2006-12-08 15:59:45 UTC (rev 2021)
+++ trunk/src/utilfuns/swbuf.cpp	2006-12-08 16:00:32 UTC (rev 2022)
@@ -98,7 +98,7 @@
 	if (max < 0)
 		max = strlen(str);
 	assureMore(max+1);
-	for (;((*str)&&(max));max--)
+	for (;((max)&&(*str));max--)
 		*end++ = *str++;
 	*end = 0;
 }




More information about the sword-cvs mailing list