diff --git a/Common/GmshMessage.cpp b/Common/GmshMessage.cpp index c6c9fe2733032e2997e2dbf3bf9777bb9d35b95e..ee8699e46e55949b9082fc5e15019c80fee60fcf 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 7d53adcb445242cf7c4eb3d473134d448b97871e..dc940424653a42e71a2ff6945ae3ff72ccd117a0 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++;