Prechádzať zdrojové kódy

2022-06-06 / Wendell

Actions
1. [mod] trim number logic

Files
1. As follow commit history

Image version : V2.02.XX.XXXX.XX
Wendell 2 rokov pred
rodič
commit
de46630687

+ 6 - 2
EVSE/Projects/DO360/Apps/Common.c

@@ -143,7 +143,7 @@ int StoreEvCommMsg(const char *fmt, ...)
 
     return rc;
 }
-
+
 void GetClockTime(struct timespec *_now_time)
 {
     clock_gettime(CLOCK_MONOTONIC, _now_time);
@@ -343,7 +343,11 @@ int Trim_String(char *string , int len)
             }
             else
             {
-                strncpy(&string[i], &string[i + 1], len - i);
+                char temp[256];
+                memset(temp, 0x00, sizeof(temp));
+                memcpy(temp, &string[i + 1], len - i);
+
+                strncpy(&string[i], temp, len - i);
                 i -= 1;
                 len -= 1;
             }

BIN
EVSE/Projects/DO360/Images/FactoryDefaultConfig.bin


BIN
EVSE/Projects/DO360/Images/ramdisk.gz