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
|
Author: Andreas Tille <tille@debian.org>,
John Marshall <John.W.Marshall@glasgow.ac.uk>
Last-Update: Fri, 01 Oct 2021 16:44:45 +0200
Origin: https://github.com/samtools/samtools/pull/1509
Description: Fix
bam_tview_curses.c:66:2: error: format not a string literal and no format arguments [-Werror=format-security]
--- a/bam_tview_curses.c
+++ b/bam_tview_curses.c
@@ -56,15 +56,11 @@ static void curses_destroy(tview_t* base
static void curses_mvprintw(struct AbstractTview* tv,int y ,int x,const char* fmt,...)
{
- unsigned int size=tv->mcol+2;
- char* str=malloc(size);
- if(str==0) exit(EXIT_FAILURE);
va_list argptr;
va_start(argptr, fmt);
- vsnprintf(str,size, fmt, argptr);
+ if (wmove(stdscr, y, x) != ERR)
+ vw_printw(stdscr, fmt, argptr);
va_end(argptr);
- mvprintw(y,x,str);
- free(str);
}
static void curses_mvaddch(struct AbstractTview* tv,int y,int x,int ch)
|