Removed some DOS-only format specifiers.
This commit is contained in:
parent
344ab4794d
commit
5dd632a862
2 changed files with 15 additions and 4 deletions
|
|
@ -948,7 +948,7 @@ static void scanThemes(void) {
|
|||
|
||||
memcpy(entry.name, ent->d_name, nameLen);
|
||||
entry.name[nameLen] = '\0';
|
||||
snprintf(entry.path, sizeof(entry.path), "%s/%.240s", THEME_DIR, ent->d_name);
|
||||
snprintf(entry.path, sizeof(entry.path), "%s/%s", THEME_DIR, entry.name);
|
||||
arrput(sThemeEntries, entry);
|
||||
}
|
||||
|
||||
|
|
@ -991,8 +991,19 @@ static void scanWallpapers(void) {
|
|||
}
|
||||
|
||||
FileEntryT entry = {0};
|
||||
snprintf(entry.name, sizeof(entry.name), "%.63s", ent->d_name);
|
||||
snprintf(entry.path, sizeof(entry.path), "%s/%.240s", WPAPER_DIR, ent->d_name);
|
||||
|
||||
// Length-clamped memcpy instead of strncpy/snprintf because GCC
|
||||
// warns about both when d_name (255) exceeds the buffer (64),
|
||||
// even though truncation is intentional and safe.
|
||||
int32_t nl = (int32_t)strlen(ent->d_name);
|
||||
|
||||
if (nl >= (int32_t)sizeof(entry.name)) {
|
||||
nl = (int32_t)sizeof(entry.name) - 1;
|
||||
}
|
||||
|
||||
memcpy(entry.name, ent->d_name, nl);
|
||||
entry.name[nl] = '\0';
|
||||
snprintf(entry.path, sizeof(entry.path), "%s/%s", WPAPER_DIR, entry.name);
|
||||
arrput(sWpaperEntries, entry);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -491,7 +491,7 @@ bool dsgnLoadFrm(DsgnStateT *ds, const char *source, int32_t sourceLen) {
|
|||
else { setPropValue(curCtrl, key, val); }
|
||||
} else {
|
||||
if (strcasecmp(key, "Caption") == 0) { snprintf(form->caption, DSGN_MAX_TEXT, "%s", val); }
|
||||
else if (strcasecmp(key, "Layout") == 0) { snprintf(form->layout, DSGN_MAX_NAME, "%.31s", val); }
|
||||
else if (strcasecmp(key, "Layout") == 0) { strncpy(form->layout, val, DSGN_MAX_NAME - 1); form->layout[DSGN_MAX_NAME - 1] = '\0'; }
|
||||
else if (strcasecmp(key, "AutoSize") == 0) { form->autoSize = (strcasecmp(val, "True") == 0); }
|
||||
else if (strcasecmp(key, "Resizable") == 0) { form->resizable = (strcasecmp(val, "True") == 0); }
|
||||
else if (strcasecmp(key, "Centered") == 0) { form->centered = (strcasecmp(val, "True") == 0); }
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue