Fix linux warning
This commit is contained in:
@@ -57,6 +57,13 @@ errorret_t assetInitLinux(void) {
|
|||||||
*path,
|
*path,
|
||||||
ASSET_FILE_NAME
|
ASSET_FILE_NAME
|
||||||
);
|
);
|
||||||
|
// Ensure combined length does not exceed ASSET_FILE_PATH_MAX
|
||||||
|
size_t syslen = strlen(ASSET.platform.systemPath);
|
||||||
|
size_t slashlen = 1; // for '/'
|
||||||
|
size_t max_temp = ASSET_FILE_PATH_MAX - syslen - slashlen - 1; // -1 for null terminator
|
||||||
|
if(strlen(temp) > max_temp) {
|
||||||
|
temp[max_temp] = '\0';
|
||||||
|
}
|
||||||
snprintf(
|
snprintf(
|
||||||
searchPath,
|
searchPath,
|
||||||
ASSET_FILE_PATH_MAX,
|
ASSET_FILE_PATH_MAX,
|
||||||
|
|||||||
Reference in New Issue
Block a user