CVS update: php3/functions
| From: | steinm | Date: | Tue, 11 May 1999 17:00:50 +0000 |
| Subject: | CVS update: php3/functions | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-5530@lists.php.net to get a copy of this message | ||
Date: Tuesday May 11, 1999 @ 13:00
Author: steinm
Update of /repository/php3/functions
In directory php:/tmp/cvs-serv14951/functions
Modified Files:
hg_comm.c hw.c
Log Message:
- some code cleanups
Index: php3/functions/hg_comm.c
diff -u php3/functions/hg_comm.c:1.19 php3/functions/hg_comm.c:1.20
--- php3/functions/hg_comm.c:1.19 Fri Apr 30 06:29:17 1999
+++ php3/functions/hg_comm.c Tue May 11 13:00:50 1999
@@ -23,7 +23,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: hg_comm.c,v 1.19 1999/04/30 10:29:17 steinm Exp $ */
+/* $Id: hg_comm.c,v 1.20 1999/05/11 17:00:50 steinm Exp $ */
/* #define HW_DEBUG */
@@ -1888,18 +1888,18 @@
if(objid == NULL)
return(-1);
if(!sscanf(objid, "0x%x", &objectID))
- return(-1);
+ return(-2);
path = fnAttributeValue(objattr, "Path");
if(path == NULL)
- return(-1);
+ return(-3);
length = HEADER_LENGTH + sizeof(hw_objectID) + strlen(path) + 1 + 1 + strlen(text) + 1;
build_msg_header(&msg, length, msgid++, EDITTEXT_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
lowerror = LE_MALLOC;
- return(-1);
+ return(-4);
}
tmp = build_msg_int(msg.buf, objectID);
@@ -1912,14 +1912,14 @@
if ( send_hg_msg(sockfd, &msg, length) == -1 ) {
efree(msg.buf);
- return(-1);
+ return(-5);
}
efree(msg.buf);
retmsg = recv_hg_msg(sockfd);
if (retmsg == NULL) {
*text = '\0';
- return(-1);
+ return(-6);
}
ptr = (int *) retmsg->buf;
Index: php3/functions/hw.c
diff -u php3/functions/hw.c:1.31 php3/functions/hw.c:1.32
--- php3/functions/hw.c:1.31 Tue May 4 12:08:47 1999
+++ php3/functions/hw.c Tue May 11 13:00:50 1999
@@ -23,7 +23,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: hw.c,v 1.31 1999/05/04 16:08:47 steinm Exp $ */
+/* $Id: hw.c,v 1.32 1999/05/11 17:00:50 steinm Exp $ */
#if COMPILE_DL
#include "dl/phpdl.h"
#endif
@@ -2201,7 +2201,7 @@
}
/* }}} */
-/* {{{ proto hwdoc hw_new_document(int link, string data, string objrec, int size)
+/* {{{ proto hwdoc hw_new_document(string objrec, string data, int size)
Create a new document */
void php3_hw_new_document(INTERNAL_FUNCTION_PARAMETERS) {
pval *arg1, *arg2, *arg3;
@@ -2216,7 +2216,13 @@
convert_to_long(arg3);
doc = malloc(sizeof(hw_document));
+ if(NULL == doc)
+ RETURN_FALSE;
doc->data = malloc(arg3->value.lval);
+ if(NULL == doc->data) {
+ free(doc);
+ RETURN_FALSE;
+ }
memcpy(doc->data, arg2->value.str.val, arg3->value.lval);
doc->attributes = strdup(arg1->value.str.val);
doc->bodytag = NULL;
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net