diff options
author | Dennis Friis <peavey@placid.dk> | 2008-11-03 07:00:17 +0000 |
---|---|---|
committer | Dennis Friis <peavey@placid.dk> | 2008-11-03 07:00:17 +0000 |
commit | a7f3726a0a7f16bccb664871fe35e8d2f2572f00 (patch) | |
tree | 52d1d2d53186ea4a8bbeb0c879f7494a9771fde7 /misc/src/login_sql/strlib.c | |
parent | d569cd100a2f60ec99104a83c1e54306f94dd06f (diff) | |
download | tmwa-a7f3726a0a7f16bccb664871fe35e8d2f2572f00.tar.gz tmwa-a7f3726a0a7f16bccb664871fe35e8d2f2572f00.tar.bz2 tmwa-a7f3726a0a7f16bccb664871fe35e8d2f2572f00.tar.xz tmwa-a7f3726a0a7f16bccb664871fe35e8d2f2572f00.zip |
Do a bit of cleanup I never got around to do, before moving from my repo to sf.net
Diffstat (limited to 'misc/src/login_sql/strlib.c')
-rw-r--r-- | misc/src/login_sql/strlib.c | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/misc/src/login_sql/strlib.c b/misc/src/login_sql/strlib.c deleted file mode 100644 index 7f6e197..0000000 --- a/misc/src/login_sql/strlib.c +++ /dev/null @@ -1,58 +0,0 @@ -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -#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]; -} |