From 2e8a47d37109c1fd1520a0e65df6bbe579d3a67a Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Sat, 24 Aug 2013 17:36:09 -0400 Subject: [PATCH] vaearagsize the pos_str functions. --- display.c | 23 +++++++++++++++++------ extern.h | 4 ++-- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/display.c b/display.c index f28fa5c..3d2d29b 100644 --- a/display.c +++ b/display.c @@ -18,6 +18,7 @@ information: #include #include +#include #include "empire.h" #include "extern.h" @@ -667,19 +668,29 @@ Position the cursor and output a string. */ void -pos_str1(int row, int col, char *str, char *a, - int b, int c, int d, int e, int f, int g, int h) +pos_str1(int row, int col, char *str, ...) { + va_list ap; + char junkbuf[STRSIZE]; + + va_start(ap, str); (void) move (row, col); - addprintf1 (str, a, b, c, d, e, f, g, h); + vsprintf(junkbuf, str, ap); + (void) addstr (junkbuf); + va_end(ap); } void -pos_str(int row, int col, char *str, - int a, int b, int c, int d, int e, int f, int g, int h) +pos_str(int row, int col, char *str, ...) { + va_list ap; + char junkbuf[STRSIZE]; + + va_start(ap, str); (void) move (row, col); - addprintf (str, a, b, c, d, e, f, g, h); + vsprintf(junkbuf, str, ap); + (void) addstr (junkbuf); + va_end(ap); } void diff --git a/extern.h b/extern.h index d574ba5..4e9af64 100644 --- a/extern.h +++ b/extern.h @@ -160,8 +160,8 @@ void clear_screen (void); void complain (void); void delay (void); void close_disp (void); -void pos_str (int row, int col, char *str, int a, int b, int c, int d, int e, int f, int g, int h); -void pos_str1 (int row, int col, char *str, char *a, int b, int c, int d, int e, int f, int g, int h); +void pos_str (int row, int col, char *str, ...); +void pos_str1 (int row, int col, char *str, ...); void addprintf (char *str, int a, int b, int c, int d, int e, int f, int g, int h); void addprintf1 (char *str, char *a, int b, int c, int d, int e, int f, int g, int h); void addprintf2 (char *str, char *a, int b, int c, int d, char *e, char *f, int g, int h); -- 2.43.0