FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

giterr format by pks-t · Pull Request #4002 · libgit2/libgit2 · GitHub

Repository navigation

giterr format - #4002

Merged
carlosmn merged 5 commits into
libgit2:masterfrom
pks-t:pks/giterr-format
Nov 14, 2016
Merged

carlosmn merged 5 commits into
libgit2:masterfrom
pks-t:pks/giterr-format

Conversation

pks-t commented Nov 14, 2016

Copy link
Copy Markdown
Member

While inspecting #4000, I've been very surprised to find out that we were passing a git_buf pointer to giterr_set without any warning of the compiler. Seems we didn't put a printf-attribute hint at the declaration, causing the compiler to accept whatever we put there.

Next to the many cases of "%d" instead of "%"PRIuZ which can cause us to overflow in the output, there were also three real errors where we passed a structure pointer to "%s" instead of the real value.

Copy link
Copy Markdown
Member

While this shouldn't have any effect on that issue as the address of a struct is the address of its first field, it's a good idea to tell the compiler about the printf format and fix its warnings.

carlosmn merged commit e1c1433 into libgit2:master Nov 14, 2016

Copy link
Copy Markdown
Member

Nice, thanks!

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

3 participants


Back | FazBrowse Home | New Git URL