mirror of
https://github.com/gryf/wmaker.git
synced 2026-01-24 16:25:46 +01:00
WPrefs: Prefer use of 'sizeof' instead of hard-coded values
Hard-coding a value is prone to errors when maintaining the code; using the builtin C macro 'sizeof' is a much safer choice. Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This commit is contained in:
committed by
Carlos R. Mafra
parent
738a78b3e2
commit
dae63b5e96
@@ -1512,7 +1512,7 @@ static void showData(_Panel * panel)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
if (access(path, W_OK) < 0) {
|
if (access(path, W_OK) < 0) {
|
||||||
snprintf(buf, 1024,
|
snprintf(buf, sizeof(buf),
|
||||||
_("The menu file \"%s\" referenced by "
|
_("The menu file \"%s\" referenced by "
|
||||||
"WMRootMenu is read-only.\n"
|
"WMRootMenu is read-only.\n"
|
||||||
"You cannot use WPrefs to modify it."),
|
"You cannot use WPrefs to modify it."),
|
||||||
@@ -1554,7 +1554,7 @@ static void showData(_Panel * panel)
|
|||||||
|
|
||||||
panel->menuPath = menuPath;
|
panel->menuPath = menuPath;
|
||||||
|
|
||||||
snprintf(buf, 1024,
|
snprintf(buf, sizeof(buf),
|
||||||
_("\n\nWhen saved, the menu will be written to the file\n\"%s\"."),
|
_("\n\nWhen saved, the menu will be written to the file\n\"%s\"."),
|
||||||
menuPath);
|
menuPath);
|
||||||
labelText = WMGetLabelText(panel->sections[NoInfo][0]);
|
labelText = WMGetLabelText(panel->sections[NoInfo][0]);
|
||||||
|
|||||||
Reference in New Issue
Block a user