REVIEWED: Security: strncpy() replaced by snprintf()
This commit is contained in:
parent
65abee1cba
commit
5992929e56
12 changed files with 110 additions and 109 deletions
|
|
@ -813,7 +813,7 @@ bool ExportImageAsCode(Image image, const char *fileName)
|
|||
|
||||
// Get file name from path and convert variable name to uppercase
|
||||
char varFileName[256] = { 0 };
|
||||
strncpy(varFileName, GetFileNameWithoutExt(fileName), 256 - 1); // NOTE: Using function provided by [rcore] module
|
||||
snprintf(varFileName, 256, "%s", GetFileNameWithoutExt(fileName)); // NOTE: Using function provided by [rcore] module
|
||||
for (int i = 0; varFileName[i] != '\0'; i++) if ((varFileName[i] >= 'a') && (varFileName[i] <= 'z')) { varFileName[i] = varFileName[i] - 32; }
|
||||
|
||||
// Add image information
|
||||
|
|
|
|||
Loading…
Reference in a new issue