mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
Merge pull request #1512 from kwagyeman/kwabena/fix_strncpy
Fix strncpy issue with new GCC
This commit is contained in:
commit
9d8dcf8d5c
@ -309,7 +309,7 @@ static char* find_chars_or_comment(const char* s, const char* chars)
|
||||
/* Version of strncpy that ensures dest (size bytes) is null-terminated. */
|
||||
static char* strncpy0(char* dest, const char* src, size_t size)
|
||||
{
|
||||
strncpy(dest, src, size);
|
||||
strncpy(dest, src, size - 1);
|
||||
dest[size - 1] = '\0';
|
||||
return dest;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user