Fix cppcheck warning "buffer may not be null-terminated after call to strncpy()"

This commit is contained in:
Philippe Teuwen 2013-03-06 12:38:59 +01:00
parent 3e773ab494
commit 1d5f9956fb
5 changed files with 5 additions and 0 deletions

View file

@ -130,6 +130,7 @@ static int scan_hex_fd3(uint8_t *pbtData, size_t *pszBytes, const char *pchPrefi
}
}
strncpy(pchScan, pchPrefix, 250);
pchScan[sizeof(pchScan) - 1] = '\0';
strcat(pchScan, " %04x:");
if (fscanf(fd3, pchScan, &uiBytes) < 1) {
return -1;