mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 10:07:59 +02:00
link and format
This commit is contained in:
@ -14,7 +14,7 @@ Still this is better than strcpy and a buffer overflow...
|
||||
*/
|
||||
template <size_t array_size>
|
||||
void strcpy_safe(char (&destination)[array_size], const char *source) {
|
||||
strncpy(destination, source, array_size);
|
||||
strncpy(destination, source, array_size-1);
|
||||
destination[array_size - 1] = '\0';
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user