Skip to content

a little issue in memtest #859

@erbenmo

Description

@erbenmo

in memtest.c, function memtest_progress_step (line 79)

for (j = 0; j < chars-progress_printed; j++) {
printf("%c",c);
progress_printed++;
}

I am not sure why we are incrementing progress_printed while progress_printed is also used in the for-loop predicate. I think the following should be enough:

for (j = 0; j < chars-progress_printed; j++) {
printf("%c",c);
}
progress_printed = chars

I tested both the old code and the new code on my machine and both seem work fine. It is interesting that the old code doesn't have a noticeable missing in output. I figured it might be because we are calling this function very frequently and the terminal window i have is not large enough.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions