Merge pull request #39 from cmuellner/compilation

Fix compilation issue in split_item().
This commit is contained in:
Open Source Software for Rockchip SoCs(moved to https://github.com/rockchip-linux/) 2019-06-28 11:38:42 +08:00 committed by GitHub
commit 5e44dcd9e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2826,7 +2826,7 @@ void split_item(STRING_VECTOR &vecItems, char *pszItems)
pStart = pszItems;
pos = strchr(pStart, ',');
while(pos != NULL) {
memset(szItem, 0, 100);
memset(szItem, 0, sizeof(szItem));
strncpy(szItem, pStart, pos - pStart);
strItem = szItem;
vecItems.push_back(strItem);
@ -2836,8 +2836,8 @@ void split_item(STRING_VECTOR &vecItems, char *pszItems)
pos = strchr(pStart, ',');
}
if (strlen(pStart) > 0) {
memset(szItem, 0, 100);
strncpy(szItem, pStart, strlen(pStart));
memset(szItem, 0, sizeof(szItem));
strncpy(szItem, pStart, sizeof(szItem)-1);
strItem = szItem;
vecItems.push_back(strItem);
}