Skip to content

Commit

Permalink
git-compat-util.h: #undef (v)snprintf before #define them
Browse files Browse the repository at this point in the history
When we detect that vsnprintf / snprintf are broken, we #define them
to an alternative implementation.  On OS X, stdio.h already
re-define them in `git-compat-util.h'.

Signed-off-by: Benoit Sigoure <tsunanet@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Benoit Sigoure authored and Junio C Hamano committed Jan 31, 2014
1 parent f174a25 commit ab03803
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions git-compat-util.h
Original file line number Diff line number Diff line change
Expand Up @@ -374,9 +374,15 @@ extern FILE *git_fopen(const char*, const char*);
#endif

#ifdef SNPRINTF_RETURNS_BOGUS
#ifdef snprintf
#undef snprintf
#endif
#define snprintf git_snprintf
extern int git_snprintf(char *str, size_t maxsize,
const char *format, ...);
#ifdef vsnprintf
#undef vsnprintf
#endif
#define vsnprintf git_vsnprintf
extern int git_vsnprintf(char *str, size_t maxsize,
const char *format, va_list ap);
Expand Down

0 comments on commit ab03803

Please sign in to comment.