Remove erroneous code duplicating FIX_STRING functionality, adjust ansistring array size
authorunc0rr
Mon, 19 Nov 2018 21:51:46 +0100
changeset 14249 06f2dc4deab2
parent 14248 540efb210083
child 14250 a7320c65f484
Remove erroneous code duplicating FIX_STRING functionality, adjust ansistring array size
project_files/hwc/rtl/pas2c.h
project_files/hwc/rtl/system.c
--- a/project_files/hwc/rtl/pas2c.h	Mon Nov 19 21:10:54 2018 +0300
+++ b/project_files/hwc/rtl/pas2c.h	Mon Nov 19 21:51:46 2018 +0100
@@ -7,7 +7,7 @@
 #include <math.h>
 
 #define MAX_PARAMS 64
-#define MAX_ANSISTRING_LENGTH 16383
+#define MAX_ANSISTRING_LENGTH 16382
 
 typedef union string255_
     {
--- a/project_files/hwc/rtl/system.c	Mon Nov 19 21:10:54 2018 +0300
+++ b/project_files/hwc/rtl/system.c	Mon Nov 19 21:51:46 2018 +0100
@@ -277,7 +277,7 @@
 
     FIX_STRINGA(str);
 
-    p = strchr(str.s + 1, c);
+    p = strchr(str.str, c);
 
     if (p == NULL) {
         return 0;
@@ -302,9 +302,7 @@
     FIX_STRING(substr);
     FIX_STRINGA(str);
 
-    str.s[str.len] = 0;
-
-    p = strstr(str.s + 1, substr.str);
+    p = strstr(str.str, substr.str);
 
     if (p == NULL) {
         return 0;