[NeoStats-Devel] [Commits] r2605 - trunk/modules/textserv
[email protected] Sat, 21 May 2005 07:03:13 +1000
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, "|" );