summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changelog.txt1
-rw-r--r--src/char_sql/strlib.c79
-rw-r--r--src/char_sql/strlib.h10
-rw-r--r--src/login_sql/strlib.c58
-rw-r--r--src/login_sql/strlib.h9
-rw-r--r--src/map/npc.c2
-rw-r--r--src/txt-converter/char/strlib.c66
-rw-r--r--src/txt-converter/char/strlib.h9
8 files changed, 2 insertions, 232 deletions
diff --git a/Changelog.txt b/Changelog.txt
index c1c1fd512..8b3b086bc 100644
--- a/Changelog.txt
+++ b/Changelog.txt
@@ -1,6 +1,7 @@
Date Added
12/20
+ * Fixed map-server exiting when it came across a bad NPC file [Codemaster]
* Updated Valaris' large/tiny monsters - of course, he told us what he did wrong and how to fix it :) [Codemaster & Valaris]
* Updated makefiles to new strlib locations [Codemaster]
* Moved strlib.h and strlib.c into the common directory [Codemaster]
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 <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];
-}
-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
diff --git a/src/login_sql/strlib.c b/src/login_sql/strlib.c
deleted file mode 100644
index fd8c90ef0..000000000
--- a/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';
- if(ptr) 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];
-}
diff --git a/src/login_sql/strlib.h b/src/login_sql/strlib.h
deleted file mode 100644
index ddf29ab18..000000000
--- a/src/login_sql/strlib.h
+++ /dev/null
@@ -1,9 +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);
-#endif
diff --git a/src/map/npc.c b/src/map/npc.c
index 45ffc97fb..796b23c66 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -1676,7 +1676,7 @@ static int npc_parse_script(char *w1,char *w2,char *w3,char *w4,char *first_line
if(curly_count > 0) {
printf("warning: Missing right curly at line %d\n",*lines);
script=NULL;
- exit(1);
+ //exit(1); //Wtf? We do we exit?
} else {
// printf("Ok line %d\n",*lines);
script=parse_script(srcbuf,startline);
diff --git a/src/txt-converter/char/strlib.c b/src/txt-converter/char/strlib.c
deleted file mode 100644
index 60803c1d1..000000000
--- a/src/txt-converter/char/strlib.c
+++ /dev/null
@@ -1,66 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "strlib.h"
-
-//-----------------------------------------------
-// string lib.
-unsigned char* jstrescape (unsigned char* pt) {
- //copy from here
- unsigned char * ptr;
- int i =0, j=0;
-
- //copy string to temporary
- ptr = malloc(J_MAX_MALLOC_SIZE);
- strcpy (ptr,pt);
-
- while (ptr[i] != '\0') {
- switch (ptr[i]) {
- 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;
- 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;
- default:
- pt[j++] = spt[i++];
- }
- }
- // copy size is 0 ~ (j-1)
- return j;
-}
diff --git a/src/txt-converter/char/strlib.h b/src/txt-converter/char/strlib.h
deleted file mode 100644
index 442cfac29..000000000
--- a/src/txt-converter/char/strlib.h
+++ /dev/null
@@ -1,9 +0,0 @@
-#ifndef _J_STR_H_
-#define _J_STR_H_
-#define J_MAX_MALLOC_SIZE 65535
-//string functions.
-//code by Jioh L. Jung
-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