mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-10-20 05:01:51 -04:00
UI: Fix snprintf calls with literals as buffer sizes
This commit is contained in:
3 files changed
+11
-8
No files matched your search
@@ -373,13 +373,15 @@ void OBSBasic::DeleteProfile(const char *profileName, const char *profileDir)
|
||||
char profilePath[512];
|
||||
char basePath[512];
|
||||
|
||||
int ret = GetConfigPath(basePath, 512, "obs-studio/basic/profiles");
|
||||
int ret = GetConfigPath(basePath, sizeof(basePath),
|
||||
"obs-studio/basic/profiles");
|
||||
if (ret <= 0) {
|
||||
blog(LOG_WARNING, "Failed to get profiles config path");
|
||||
return;
|
||||
}
|
||||
|
||||
ret = snprintf(profilePath, 512, "%s/%s/*", basePath, profileDir);
|
||||
ret = snprintf(profilePath, sizeof(profilePath), "%s/%s/*", basePath,
|
||||
profileDir);
|
||||
if (ret <= 0) {
|
||||
blog(LOG_WARNING, "Failed to get path for profile dir '%s'",
|
||||
profileDir);
|
||||
@@ -404,7 +406,8 @@ void OBSBasic::DeleteProfile(const char *profileName, const char *profileDir)
|
||||
|
||||
os_globfree(glob);
|
||||
|
||||
ret = snprintf(profilePath, 512, "%s/%s", basePath, profileDir);
|
||||
ret = snprintf(profilePath, sizeof(profilePath), "%s/%s", basePath,
|
||||
profileDir);
|
||||
if (ret <= 0) {
|
||||
blog(LOG_WARNING, "Failed to get path for profile dir '%s'",
|
||||
profileDir);
|
||||
|
||||
Reference in new issue
Block a user