mirror of
https://github.com/arendst/Tasmota.git
synced 2025-04-24 14:57:16 +00:00
Simplified Function Substr
This commit is contained in:
parent
2fdc91f1b4
commit
420be8f499
@ -143,7 +143,7 @@ char* subStr(char* dest, char* str, const char *delim, int index)
|
||||
int i;
|
||||
|
||||
// Since strtok consumes the first arg, make a copy
|
||||
strncpy(dest, str, strlen(str));
|
||||
strncpy(dest, str, strlen(str)+1);
|
||||
for (i = 1, act = dest; i <= index; i++, act = NULL) {
|
||||
sub = strtok_r(act, delim, &ptr);
|
||||
if (sub == NULL) break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user