File: fix-format-string.patch

package info (click to toggle)
mcabber 1.1.2-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 4,872 kB
  • sloc: ansic: 20,518; sh: 4,268; makefile: 128; python: 95; perl: 80
file content (42 lines) | stat: -rw-r--r-- 1,523 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
Description: Fix wrong format string in titlebar
Author: Martin <debacle@debian.org>
Origin: vendor
Last-Update: 2021-10-24
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/mcabber/screen.c
+++ b/mcabber/screen.c
@@ -1278,12 +1278,12 @@
         tmp = pref[timelen];
         pref[timelen] = '\0';
         wbkgdset(win_entry->win, get_color(COLOR_TIMESTAMP));
-        wprintw(win_entry->win, pref);
+        wprintw(win_entry->win, "%s", pref);
         pref[timelen] = tmp;
         wbkgdset(win_entry->win, get_color(color));
-        wprintw(win_entry->win, pref+timelen);
+        wprintw(win_entry->win, "%s", pref+timelen);
       } else
-        wprintw(win_entry->win, pref);
+        wprintw(win_entry->win, "%s", pref);
 
       // Make sure we are at the right position
       wmove(win_entry->win, winy, prefixwidth-1);
@@ -1362,7 +1362,7 @@
         wmove(win_entry->win, winy, 0);
         wbkgdset(win_entry->win, get_color(COLOR_READMARK));
         g_snprintf(pref, prefixwidth, "             == ");
-        wprintw(win_entry->win, pref);
+        wprintw(win_entry->win, "%s", pref);
         w = scr_gettextwidth() / 3;
         for (i=0; i<w; i++)
           wprintw(win_entry->win, "== ");
@@ -1782,7 +1782,7 @@
 
   ver = mcabber_version();
   message = g_strdup_printf("MCabber version %s.\n", ver);
-  mvwprintw(chatWnd, 0, 0, message);
+  mvwprintw(chatWnd, 0, 0, "%s", message);
   mvwprintw(chatWnd, 1, 0, "http://mcabber.com/");
   g_free(ver);
   g_free(message);