[NeoStats-Devel] [Commits] r2605 - trunk/modules/textserv

[email protected]
Newsgroups gmane.comp.neostats.devel
Message-ID <[email protected]>
Author: Mark
Date: Sat May 21 05:02:49 2005
New Revision: 2605

Modified:
   trunk/modules/textserv/main.c
Log:
fix bug in textserv allocations

Modified: trunk/modules/textserv/main.c
==============================================================================
--- trunk/modules/textserv/main.c	(original)
+++ trunk/modules/textserv/main.c	Sat May 21 05:02:49 2005
@@ -294,7 +294,7 @@
 		if( !ptr )
 			return NS_FAILURE;
 		dlog( DEBUG1, "about %s", ptr );
-		ptr2 = ns_malloc( strlen( ptr ) );
+		ptr2 = ns_malloc( strlen( ptr ) + 1 );
 		strcpy( ptr2, ptr );
 		db->abouttext = ptr2;
 		return NS_SUCCESS;		
@@ -305,7 +305,7 @@
 		if( !ptr )
 			return NS_FAILURE;
 		dlog( DEBUG1, "credits %s", ptr );
-		ptr2 = ns_malloc( strlen( ptr ) );
+		ptr2 = ns_malloc( strlen( ptr ) + 1 );
 		strcpy( ptr2, ptr );
 		db->creditstext = ptr2;
 		return NS_SUCCESS;		
@@ -316,7 +316,7 @@
 		if( !ptr )
 			return NS_FAILURE;
 		dlog( DEBUG1, "credits %s", ptr );
-		ptr2 = ns_malloc( strlen( ptr ) );
+		ptr2 = ns_malloc( strlen( ptr ) + 1 );
 		strcpy( ptr2, ptr );
 		db->versiontext = ptr2;
 		return NS_SUCCESS;		
@@ -325,7 +325,7 @@
 	{
 		readcount++;
 		dlog( DEBUG1, "read %s", ptr );
-		ptr2 = ns_malloc( strlen( ptr ) );
+		ptr2 = ns_malloc( strlen( ptr ) + 1 );
 		strcpy( ptr2, ptr );
 		AddStringToList( &db->stringlist, ptr2, &db->stringcount );
 		ptr = strtok( NULL, "|" );
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.