mirror of
https://github.com/wiiu-env/libmocha.git
synced 2024-11-22 19:39:18 +01:00
devoptab: Replace strncopy with snprintf
This commit is contained in:
parent
1c896143fa
commit
455ecf6997
@ -31,7 +31,8 @@ int __fsa_dirnext(struct _reent *r,
|
|||||||
|
|
||||||
__fsa_translate_stat(&dir->entry_data.info, filestat);
|
__fsa_translate_stat(&dir->entry_data.info, filestat);
|
||||||
|
|
||||||
memset(filename, 0, NAME_MAX);
|
if (snprintf(filename, NAME_MAX, "%s", dir->entry_data.name) >= NAME_MAX) {
|
||||||
strncpy(filename, dir->entry_data.name, NAME_MAX - 1);
|
DEBUG_FUNCTION_LINE_ERR("snprintf filename result was truncated\n");
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user