From dae63b5e96a35eac8e805f84ea42008c157c0aa4 Mon Sep 17 00:00:00 2001 From: Christophe CURIS Date: Fri, 22 Feb 2019 15:48:14 +0100 Subject: [PATCH] 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 --- WPrefs.app/Menu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/WPrefs.app/Menu.c b/WPrefs.app/Menu.c index 54e53faa..810a26b6 100644 --- a/WPrefs.app/Menu.c +++ b/WPrefs.app/Menu.c @@ -1512,7 +1512,7 @@ static void showData(_Panel * panel) break; if (access(path, W_OK) < 0) { - snprintf(buf, 1024, + snprintf(buf, sizeof(buf), _("The menu file \"%s\" referenced by " "WMRootMenu is read-only.\n" "You cannot use WPrefs to modify it."), @@ -1554,7 +1554,7 @@ static void showData(_Panel * panel) panel->menuPath = menuPath; - snprintf(buf, 1024, + snprintf(buf, sizeof(buf), _("\n\nWhen saved, the menu will be written to the file\n\"%s\"."), menuPath); labelText = WMGetLabelText(panel->sections[NoInfo][0]); -- 2.11.4.GIT