Merge pull request #3710 from ascillato/patch-1

Fix Exception Issue
This commit is contained in:
Theo Arends 2018-09-06 08:44:03 +02:00 committed by GitHub
commit 3f1f3dec34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -143,7 +143,7 @@ char* subStr(char* dest, char* str, const char *delim, int index)
int i; int i;
// Since strtok consumes the first arg, make a copy // Since strtok consumes the first arg, make a copy
strlcpy(dest, str, strlen(str)); strncpy(dest, str, strlen(str));
for (i = 1, act = dest; i <= index; i++, act = NULL) { for (i = 1, act = dest; i <= index; i++, act = NULL) {
sub = strtok_r(act, delim, &ptr); sub = strtok_r(act, delim, &ptr);
if (sub == NULL) break; if (sub == NULL) break;