From 3fbd8058559537e175f6c05bb0fcfa5b195e3a30 Mon Sep 17 00:00:00 2001 From: rswindell <> Date: Wed, 25 Mar 2020 06:06:32 +0000 Subject: [PATCH] Refactor the pop() method to erase the last pop-message without leaving the cursor in a weird place (e.g. in column 79). --- src/uifc/uifcx.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/uifc/uifcx.c b/src/uifc/uifcx.c index b138fd0af6..9bfb1b39ea 100644 --- a/src/uifc/uifcx.c +++ b/src/uifc/uifcx.c @@ -361,10 +361,12 @@ void umsg(char *str) /****************************************************************************/ void upop(char *str) { + static size_t len; + if(str==NULL) - printf("\n"); + printf("\r%*s\r", len, ""); else - printf("\r%-79s",str); + len = printf("\r%s\r", str) - 2; } /****************************************************************************/ -- GitLab