Got rid of a strcpy

pull/4/head
Paul Hollinsky 2018-09-25 18:46:05 -04:00
parent 650b46fad2
commit 6a0c28cb3d
1 changed files with 2 additions and 1 deletions

View File

@ -56,7 +56,8 @@ bool icsneoSerialNumToString(uint32_t num, char* str, size_t* count) {
*count = result.length() + 1; // This is how big of a buffer we need
return false;
}
strcpy(str, result.c_str()); // TODO bad
strncpy(str, result.c_str(), *count);
str[*count - 1] = '\0';
*count = result.length();
return true;
}