CVS update: php3/functions
| From: | sas | Date: | Wed, 06 Jan 1999 12:58:19 +0000 |
| Subject: | CVS update: php3/functions | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-3328@lists.php.net to get a copy of this message | ||
Date: Wednesday January 6, 1999 @ 7:58
Author: sas
Update of /repository/php3/functions
In directory asf:/u/temp/cvs-serv13887/functions
Modified Files:
wddx.c
Log Message:
some cleanups
Index: php3/functions/wddx.c
diff -c php3/functions/wddx.c:1.1 php3/functions/wddx.c:1.2
*** php3/functions/wddx.c:1.1 Tue Jan 5 20:32:54 1999
--- php3/functions/wddx.c Wed Jan 6 07:58:17 1999
***************
*** 27,33 ****
+----------------------------------------------------------------------+
*/
! /* $Id: wddx.c,v 1.1 1999/01/06 01:32:54 sas Exp $ */
#include "php.h"
#include "internal_functions.h"
--- 27,33 ----
+----------------------------------------------------------------------+
*/
! /* $Id: wddx.c,v 1.2 1999/01/06 12:58:17 sas Exp $ */
#include "php.h"
#include "internal_functions.h"
***************
*** 131,137 ****
new = _php3_wddx_build(NULL, obj);
len += strlen(new);
off = erealloc(buf, len);
! if(!off) return empty_string;
buf = off;
strcat(buf, new);
efree(new);
--- 131,140 ----
new = _php3_wddx_build(NULL, obj);
len += strlen(new);
off = erealloc(buf, len);
! if(!off) {
! efree(buf);
! return empty_string;
! }
buf = off;
strcat(buf, new);
efree(new);
***************
*** 163,169 ****
efree(key);
len += strlen(new);
off = erealloc(buf, len);
! if(!off) return empty_string;
buf = off;
strcat(buf, new);
efree(new);
--- 166,175 ----
efree(key);
len += strlen(new);
off = erealloc(buf, len);
! if(!off) {
! efree(buf);
! return empty_string;
! }
buf = off;
strcat(buf, new);
efree(new);
***************
*** 196,202 ****
static char *_php3_wddx_build(char *name, pval *obj)
{
! char *str = NULL;
switch(obj->type) {
case IS_LONG:
--- 202,208 ----
static char *_php3_wddx_build(char *name, pval *obj)
{
! char *str = empty_string;
switch(obj->type) {
case IS_LONG:
***************
*** 213,219 ****
break;
}
! return str ? _php3_wddx_var(name, str) : empty_string;
}
/* }}} */
/* }}} */
--- 219,225 ----
break;
}
! return _php3_wddx_var(name, str);
}
/* }}} */
/* }}} */
***************
*** 256,263 ****
wddx->last_type = LT_VAR;
for(i = 0; atts[i]; i++)
! if(!strncmp("name", atts[i], 4)) {
! wddx->var_name = estrdup(atts[i+1]);
break;
}
} else if(!strcmp(name, "string")) {
--- 262,269 ----
wddx->last_type = LT_VAR;
for(i = 0; atts[i]; i++)
! if(!strcmp("name", atts[i])) {
! if(atts[i + 1]) wddx->var_name = estrdup(atts[i + 1]);
break;
}
} else if(!strcmp(name, "string")) {
***************
*** 267,275 ****
} else if(!strcmp(name, "array") || !strcmp(name, "struct")) {
wddx->last_type = LT_ARRAY;
FIRST;
- wddx->notfirst = 0;
VAR_NAME;
ATTACH("array(");
}
}
/* }}} */
--- 273,281 ----
} else if(!strcmp(name, "array") || !strcmp(name, "struct")) {
wddx->last_type = LT_ARRAY;
FIRST;
VAR_NAME;
ATTACH("array(");
+ wddx->notfirst = 0;
}
}
/* }}} */
--
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