From bf4c341e7d8e585f42fcfeac9df09a89a52800c9 Mon Sep 17 00:00:00 2001 From: rswindell <> Date: Tue, 10 Oct 2017 07:17:13 +0000 Subject: [PATCH] Add printf member functoin to stdio versoin of uifc. This was causing echocfg v3 to crash when used with the '-iD' option. Oops. --- src/uifc/uifcx.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/uifc/uifcx.c b/src/uifc/uifcx.c index a3bc2004f2..0d34a25b92 100644 --- a/src/uifc/uifcx.c +++ b/src/uifc/uifcx.c @@ -1,5 +1,3 @@ -/* uifcx.c */ - /* Standard I/O Implementation of UIFC (user interface) library */ /* $Id$ */ @@ -8,7 +6,7 @@ * @format.tab-size 4 (Plain Text/Source Code File Header) * * @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) * * * - * Copyright 2010 Rob Swindell - http://www.synchro.net/copyright.html * + * Copyright Rob Swindell - http://www.synchro.net/copyright.html * * * * This library is free software; you can redistribute it and/or * * modify it under the terms of the GNU Lesser General Public License * @@ -62,6 +60,22 @@ static void umsg(char *str); static void upop(char *str); static void sethelp(int line, char* file); +/****************************************************************************/ +/****************************************************************************/ +static int uprintf(int x, int y, unsigned attr, char *fmat, ...) +{ + va_list argptr; + char str[MAX_COLS + 1]; + int i; + + va_start(argptr, fmat); + vsprintf(str, fmat, argptr); + va_end(argptr); + i = printf("%s", str); + return(i); +} + + /****************************************************************************/ /* Initialization function, see uifc.h for details. */ /* Returns 0 on success. */ @@ -85,6 +99,7 @@ int UIFCCALL uifcinix(uifcapi_t* uifcapi) api->showhelp=help; api->showbuf=NULL; api->timedisplay=NULL; + api->printf = uprintf; setvbuf(stdin,NULL,_IONBF,0); setvbuf(stdout,NULL,_IONBF,0); -- GitLab