editres-format-strings

Fix build error with -Werror=format-security

geometry.c: In function '_FindWidget':
geometry.c:66:5: error: format not a string literal and no format arguments [-Werror=format-security]
     sprintf(msg, res_labels[14]);
     ^
geometry.c: In function 'DisplayChild':
geometry.c:106:2: error: format not a string literal and no format arguments [-Werror=format-security]
  sprintf(msg, res_labels[13]);
  ^
cc1: some warnings being treated as errors



Gbp-Pq: Name editres-format-strings.diff
This commit is contained in:
Debian X Strike Force 2022-05-14 03:19:12 +08:00 committed by openKylinBot
parent 53f703349d
commit 1a55c82cd5
3 changed files with 4 additions and 4 deletions

View File

@ -63,7 +63,7 @@ _FindWidget(Widget w)
Window win;
int x, y; /* location of event in root coordinates. */
snprintf(msg, sizeof(msg), res_labels[14]);
snprintf(msg, sizeof(msg), "%s", res_labels[14]);
SetMessage(global_screen_data.info_label, msg);
@ -103,7 +103,7 @@ DisplayChild(Event *event)
find_event->widgets.num_widgets);
if (node == NULL) {
snprintf(msg, sizeof(msg), res_labels[13]);
snprintf(msg, sizeof(msg), "%s", res_labels[13]);
SetMessage(global_screen_data.info_label, msg);
return;
}

View File

@ -127,7 +127,7 @@ ModifySVEntry(Widget w, XEvent *event, String *params, Cardinal *num_params)
old = global_screen_data.res_text;
break;
default:
snprintf(msg, sizeof(msg), res_labels[22]);
snprintf(msg, sizeof(msg), "%s", res_labels[22]);
SetMessage(global_screen_data.info_label, msg);
return;
}

View File

@ -518,7 +518,7 @@ HandleGetResources(Event *event)
get_event->info[i].widgets.num_widgets);
if (node == NULL) {
snprintf(buf, sizeof(buf), res_labels[16]);
snprintf(buf, sizeof(buf), "%s", res_labels[16]);
AddString(&errors, buf);
continue;
}