From 522600b0c4f8d51b5b6285c629868eba5e788dcd Mon Sep 17 00:00:00 2001 From: codemaster Date: Mon, 20 Dec 2004 20:41:38 +0000 Subject: * Fixed map-server exiting when it came across a bad NPC file [Codemaster] git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@685 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/char_sql/strlib.c | 79 --------------------------------------------------- src/char_sql/strlib.h | 10 ------- 2 files changed, 89 deletions(-) delete mode 100644 src/char_sql/strlib.c delete mode 100644 src/char_sql/strlib.h (limited to 'src/char_sql') diff --git a/src/char_sql/strlib.c b/src/char_sql/strlib.c deleted file mode 100644 index b113d96f5..000000000 --- a/src/char_sql/strlib.c +++ /dev/null @@ -1,79 +0,0 @@ -#include -#include -#include - -#include "strlib.h" -#include "utils.h" - -//----------------------------------------------- -// string lib. -unsigned char* jstrescape (unsigned char* pt) { - //copy from here - unsigned char * ptr; - int i =0, j=0; - - //copy string to temporary - CREATE(ptr, char, J_MAX_MALLOC_SIZE); - strcpy (ptr,pt); - - while (ptr[i] != '\0') { - switch (ptr[i]) { - case '\'': - pt[j++] = '\\'; - pt[j++] = ptr[i++]; - break; - case '\\': - pt[j++] = '\\'; - pt[j++] = ptr[i++]; - break; - default: - pt[j++] = ptr[i++]; - } - } - pt[j++] = '\0'; - free (ptr); - return (unsigned char*) &pt[0]; -} - -unsigned char* jstrescapecpy (unsigned char* pt,unsigned char* spt) { - //copy from here - int i =0, j=0; - - while (spt[i] != '\0') { - switch (spt[i]) { - case '\'': - pt[j++] = '\\'; - pt[j++] = spt[i++]; - break; - case '\\': - pt[j++] = '\\'; - pt[j++] = spt[i++]; - break; - default: - pt[j++] = spt[i++]; - } - } - pt[j++] = '\0'; - return (unsigned char*) &pt[0]; -} -int jmemescapecpy (unsigned char* pt,unsigned char* spt, int size) { - //copy from here - int i =0, j=0; - - while (i < size) { - switch (spt[i]) { - case '\'': - pt[j++] = '\\'; - pt[j++] = spt[i++]; - break; - case '\\': - pt[j++] = '\\'; - pt[j++] = spt[i++]; - break; - default: - pt[j++] = spt[i++]; - } - } - // copy size is 0 ~ (j-1) - return j; -} diff --git a/src/char_sql/strlib.h b/src/char_sql/strlib.h deleted file mode 100644 index 6b6169083..000000000 --- a/src/char_sql/strlib.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef _J_STR_LIB_H_ -#define _J_STR_LIB_H_ -#define J_MAX_MALLOC_SIZE 65535 -// String function library. -// code by Jioh L. Jung (ziozzang@4wish.net) -// This code is under license "BSD" -unsigned char* jstrescape (unsigned char* pt); -unsigned char* jstrescapecpy (unsigned char* pt,unsigned char* spt); -int jmemescapecpy (unsigned char* pt,unsigned char* spt, int size); -#endif -- cgit v1.2.3-70-g09d2