Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.23.1 bugfix patch #8

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/mfaktc.c
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,7 @@ see benchmarks in src/kernel_benchmarks.txt */
{
if (numfactors > 0)
{
char temp_factors_string[500];
char factorstring[50];
int96 factor;
for (i = 0; (i < numfactors) && (i < 10); i++)
Expand All @@ -395,7 +396,8 @@ see benchmarks in src/kernel_benchmarks.txt */
factor.d1 = mystuff->h_RES[i * 3 + 2];
factor.d0 = mystuff->h_RES[i * 3 + 3];
print_dez96(factor, factorstring);
sprintf(mystuff->factors_string, mystuff->factors_string[0] ? "%s,\"%s\"" : "%s\"%s\"", mystuff->factors_string, factorstring);
sprintf(temp_factors_string, mystuff->factors_string[0] ? "%s,\"%s\"" : "%s\"%s\"", mystuff->factors_string, factorstring);
sprintf(mystuff->factors_string, temp_factors_string);
}
}
if(mystuff->checkpoints == 1)
Expand Down
32 changes: 25 additions & 7 deletions src/output.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,13 @@ void logprintf(mystuff_t* mystuff, const char* fmt, ...)

va_start(args, fmt);
vfprintf(stdout, fmt, args);
_logf(mystuff, fmt, args);
va_end(args);
}

void _logf(mystuff_t* mystuff, const char* fmt, ...)
{
va_list args;

if (mystuff->logging == 1 && mystuff->logfileptr != NULL) {
va_start(args, fmt);
Expand Down Expand Up @@ -366,16 +372,28 @@ void print_status_line(mystuff_t *mystuff)

if(mystuff->mode == MODE_NORMAL)
{
if(mystuff->printmode == 1)index += sprintf(buffer + index, "\r");
else index += sprintf(buffer + index, "\n");
if (mystuff->printmode == 1)
{
buffer[index] = 0;
printf("%s\r", buffer);
_logf(mystuff, "%s\n", buffer);
}
else
{
index += sprintf(buffer + index, "\n");
buffer[index] = 0;
logprintf(mystuff, "%s", buffer);
}
}
if(mystuff->mode == MODE_SELFTEST_FULL && mystuff->printmode == 0)
else
{
index += sprintf(buffer + index, "\n");
if (mystuff->mode == MODE_SELFTEST_FULL && mystuff->printmode == 0)
{
index += sprintf(buffer + index, "\n");
}
buffer[index] = 0;
logprintf(mystuff, "%s", buffer);
}

buffer[index] = 0;
logprintf(mystuff, "%s", buffer);
}

void get_utc_timestamp(char* timestamp)
Expand Down
1 change: 1 addition & 0 deletions src/output.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ extern "C" {
#endif
void print_help(char *string);
void logprintf(mystuff_t* mystuff, const char* fmt, ...);
void _logf(mystuff_t* mystuff, const char* fmt, ...);

void print_dez72(int72 a, char *buf);
void print_dez144(int144 a, char *buf);
Expand Down
2 changes: 1 addition & 1 deletion src/params.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ code path */
*******************************************************************************
******************************************************************************/

#define MFAKTC_VERSION "0.23.0" /* DO NOT CHANGE! */
#define MFAKTC_VERSION "0.23.1" /* DO NOT CHANGE! */



Expand Down