From 4d714ac94963eae93ae0e82d4b3f98a73c8f2933 Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Mon, 17 Nov 2008 17:26:04 +0000 Subject: [PATCH] *** empty log message *** --- Common/GmshMessage.cpp | 9 ++++----- Common/Options.cpp | 4 ++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Common/GmshMessage.cpp b/Common/GmshMessage.cpp index c6c9fe2733..ee8699e46e 100644 --- a/Common/GmshMessage.cpp +++ b/Common/GmshMessage.cpp @@ -257,10 +257,7 @@ void Msg::Direct(const char *fmt, ...) vsnprintf(str, sizeof(str), fmt, args); va_end(args); - if(strlen(str)) - Direct(3, str); - else - Direct(3, " "); + Direct(3, str); } void Msg::Direct(int level, const char *fmt, ...) @@ -360,13 +357,15 @@ void Msg::ProgressMeter(int n, int N, const char *fmt, ...) double percent = 100. * (double)n/(double)N; if(percent >= _progressMeterCurrent){ - char str[1024], str2[1024]; + char str[1024]; va_list args; va_start(args, fmt); vsnprintf(str, sizeof(str), fmt, args); va_end(args); if(strlen(fmt)) strcat(str, " "); + + char str2[1024]; sprintf(str2, "(%d %%)", _progressMeterCurrent); strcat(str, str2); diff --git a/Common/Options.cpp b/Common/Options.cpp index 7d53adcb44..dc94042465 100644 --- a/Common/Options.cpp +++ b/Common/Options.cpp @@ -93,17 +93,17 @@ static void Print_StringOptions(int num, int level, int diff, int help, StringXString s[], const char *prefix, FILE *file) { int i = 0; - char tmp[1024]; while(s[i].str) { if(s[i].level & level) { if(!diff || strcmp(s[i].function(num, GMSH_GET, NULL), s[i].def)){ + char tmp[1024]; sprintf(tmp, "%s%s = \"%s\";%s%s", prefix, s[i].str, s[i].function(num, GMSH_GET, NULL), help ? " // " : "", help ? s[i].help : ""); if(file) fprintf(file, "%s\n", tmp); else - Msg::Direct(tmp); + Msg::Direct(3, "%s", tmp); } } i++; -- GitLab