summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/common')
-rw-r--r--src/common/strlib.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/common/strlib.c b/src/common/strlib.c
index 12c34556f..361c693c1 100644
--- a/src/common/strlib.c
+++ b/src/common/strlib.c
@@ -48,6 +48,11 @@ char* jstrescapecpy (char* pt,char* spt) {
//a escape character is found, the target's final length increases! [Skotlex]
int i =0, j=0;
+ if (!spt) { //Return an empty string [Skotlex]
+ pt[0] = '\0';
+ return &pt[0];
+ }
+
while (spt[i] != '\0') {
switch (spt[i]) {
case '\'':