Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

DrawTextFormatBar: nonsensical numbers could cause a panic #5

Merged
merged 2 commits into from
Oct 23, 2015

Conversation

cgonyeo
Copy link

@cgonyeo cgonyeo commented Oct 7, 2015

If one of the numbers provided to draw the progress bar was nonsensical,
like the total download size being 0, ioprogress would cause a panic.

This adds a check for a unexpected current progress, and will display an
empty bar if it's outside acceptable bounds.

@jonboulle
Copy link

Add a test case?

Derek Gonyeo added 2 commits October 7, 2015 12:13
With a recent change ioprogress now checks if it's printing to a
terminal and will use "\n" instead of "\r" if it is not. The tests were
expecting ioprogress to print "\r"s, but since ioprogress is not
printing to a terminal that was no longer the case
If one of the numbers provided to draw the progress bar was nonsensical,
like the total download size being 0, the library would cause a panic.

This adds a check for a unexpected current progress, and will display an
empty bar if it's outside acceptable bounds.
jonboulle added a commit that referenced this pull request Oct 23, 2015
DrawTextFormatBar: nonsensical numbers could cause a panic
@jonboulle jonboulle merged commit 4637e49 into coreos:master Oct 23, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants