Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

ethomson
Copy link
Member

Local transports don't have data about the size, avoid dividing by
zero in the callback.

Fixes #2812

int index_percent = (100*pd->fetch_progress.indexed_objects) / pd->fetch_progress.total_objects;
int network_percent, index_percent;

if (!pd->fetch_progress.total_objects || !pd->total_steps)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't total_steps checked below?

Local transports don't have data about the size, avoid dividing by
zero in the callback.
@Therzok
Copy link
Member

Therzok commented Jan 10, 2015

That looks way better. 👍

@ethomson
Copy link
Member Author

Thanks, @Therzok !

carlosmn added a commit that referenced this pull request Jan 12, 2015
clone example: don't divide by zero
@carlosmn carlosmn merged commit 04bdd97 into libgit2:master Jan 12, 2015
@ethomson ethomson deleted the example branch February 5, 2015 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

clone bare repo ended with"Floating point exception"
4 participants