summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/ereg/ereg.c2
-rw-r--r--ext/standard/reg.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/ext/ereg/ereg.c b/ext/ereg/ereg.c
index c839e1ab12..1373933780 100644
--- a/ext/ereg/ereg.c
+++ b/ext/ereg/ereg.c
@@ -319,7 +319,7 @@ char *_php3_regreplace(const char *pattern, const char *replace, const char *str
string_len = strlen(string);
if (!string_len)
- return (char *)string;
+ return estrndup("", 0);
if (icase)
copts = REG_ICASE;
diff --git a/ext/standard/reg.c b/ext/standard/reg.c
index c839e1ab12..1373933780 100644
--- a/ext/standard/reg.c
+++ b/ext/standard/reg.c
@@ -319,7 +319,7 @@ char *_php3_regreplace(const char *pattern, const char *replace, const char *str
string_len = strlen(string);
if (!string_len)
- return (char *)string;
+ return estrndup("", 0);
if (icase)
copts = REG_ICASE;