diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-03-26 05:47:22 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-03-26 05:47:22 +0000 |
commit | 19dadc72ab415ac14aead231c63e2b6fe28be2cf (patch) | |
tree | 65292b8930443bfac8563a9a6b03f4934543e449 /src/common/strlib.c | |
parent | ab56858e0611a8075c06807712622b920d17ba8a (diff) | |
download | hercules-19dadc72ab415ac14aead231c63e2b6fe28be2cf.tar.gz hercules-19dadc72ab415ac14aead231c63e2b6fe28be2cf.tar.bz2 hercules-19dadc72ab415ac14aead231c63e2b6fe28be2cf.tar.xz hercules-19dadc72ab415ac14aead231c63e2b6fe28be2cf.zip |
- Fixed jstrescapecpy crashing when you pass a null string to parse.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5753 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/common/strlib.c')
-rw-r--r-- | src/common/strlib.c | 5 |
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 '\'':
|