cvs: php4 /ext/xslt sablot.c
| From: | Sterling Hughes | Date: | Sat, 15 Sep 2001 16:05:37 +0000 |
| Subject: | cvs: php4 /ext/xslt sablot.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-7424@lists.php.net to get a copy of this message | ||
sterling Sat Sep 15 12:05:37 2001 EDT
Modified files:
/php4/ext/xslt sablot.c
Log:
fix this in a couple of other places and use estrndup() when we have the
string length.
Index: php4/ext/xslt/sablot.c
diff -u php4/ext/xslt/sablot.c:1.23 php4/ext/xslt/sablot.c:1.24
--- php4/ext/xslt/sablot.c:1.23 Sat Sep 15 12:00:46 2001
+++ php4/ext/xslt/sablot.c Sat Sep 15 12:05:36 2001
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: sablot.c,v 1.23 2001/09/15 16:00:46 sterling Exp $ */
+/* $Id: sablot.c,v 1.24 2001/09/15 16:05:36 sterling Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -1301,18 +1301,18 @@
key = emalloc(pos + 1);
val = emalloc((len - pos) + 1);
- strlcpy(key, *fields, pos);
- strlcpy(val, *fields + pos + 1, len - pos - 1);
+ strlcpy(key, *fields, pos + 1);
+ strlcpy(val, *fields + pos + 1, len - pos);
/* Check to see whether or not we want to save the data */
if (!strcmp(key, "msg")) {
- errmsg = estrndup(val, len - pos -1);
+ errmsg = estrndup(val, len - pos);
}
else if (!strcmp(key, "type")) {
- errtype = estrndup(val, len - pos - 1);
+ errtype = estrndup(val, len - pos);
}
else if (!strcmp(key, "line")) {
- errline = estrndup(val, len - pos - 1);
+ errline = estrndup(val, len - pos);
}
/* Cleanup */
@@ -1449,8 +1449,8 @@
key = emalloc(pos + 1);
val = emalloc((len - pos) + 1);
- strlcpy(key, *fields, pos);
- strlcpy(val, *fields + pos + 1, len - pos - 1);
+ strlcpy(key, *fields, pos + 1);
+ strlcpy(val, *fields + pos + 1, len - pos);
/* Add it */
add_assoc_stringl_ex(argv[3], key, pos, val, len - pos - 1, 1);
@@ -1512,10 +1512,10 @@
/* Check to see whether or not we want to save the data */
if (!strcmp(key, "msg")) {
- errmsg = estrdup(val);
+ errmsg = estrndup(val, len - pos);
}
else if (!strcmp(key, "line")) {
- errline = estrdup(val);
+ errline = estrndup(val, len - pos);
}
/* Cleanup */