cvs commit

From: Date: Mon, 05 Jul 1999 11:13:08 +0000
Subject: cvs commit
Groups: php.dev 
Request: Send a blank email to php-dev+get-8099@lists.php.net to get a copy of this message
From: steinm Date: Mon Jul 5 11:13:08 1999 Modified files: php3/functions/hw.c Log message: - fixed hw_edittext bug. End of text was not marked with 0 Index: php3/functions/hw.c diff -u php3/functions/hw.c:1.40 php3/functions/hw.c:1.41 --- php3/functions/hw.c:1.40 Tue Jun 29 10:39:33 1999 +++ php3/functions/hw.c Mon Jul 5 11:13:07 1999 @@ -23,7 +23,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: hw.c,v 1.40 1999/06/29 14:39:33 steinm Exp $ */ +/* $Id: hw.c,v 1.41 1999/07/05 15:13:07 steinm Exp $ */ #if COMPILE_DL #include "dl/phpdl.h" @@ -2251,6 +2251,7 @@ Create a new document */ PHP_FUNCTION(hw_new_document) { pval *arg1, *arg2, *arg3; + char *ptr; hw_document *doc; if (ARG_COUNT(ht) != 3 || getParameters(ht, 3, &arg1, &arg2, &arg3) == FAILURE) { @@ -2264,12 +2265,14 @@ doc = malloc(sizeof(hw_document)); if(NULL == doc) RETURN_FALSE; - doc->data = malloc(arg3->value.lval); + doc->data = malloc(arg3->value.lval+1); if(NULL == doc->data) { free(doc); RETURN_FALSE; } memcpy(doc->data, arg2->value.str.val, arg3->value.lval); + ptr = doc->data; + ptr[arg3->value.lval] = '\0'; doc->attributes = strdup(arg1->value.str.val); doc->bodytag = NULL; doc->size = arg3->value.lval;

« previous php.dev (#8099) next »