author | Michal Rokos <michal.rokos@nextsoft.cz> | |
Wed, 5 Mar 2008 15:46:13 +0000 (16:46 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 5 Mar 2008 21:12:07 +0000 (13:12 -0800) | ||
commit | c4582f93a263bea534288e7f7ad8937405964cd4 | |
tree | 0347f5c0606376d6ebd8e35dd4636139711fd8ac | tree | snapshot |
parent | b9217642ef2db34e2cbeaef8d4439b07a03027cd | commit | diff |
Add compat/snprintf.c for systems that return bogus
Some systems (namely HPUX and Windows) return -1 when maxsize in snprintf()
and in vsnprintf() is reached. So replace snprintf() and vsnprintf()
functions with our own ones that return correct value upon overflow.
[jc: verified that review comments by J6t have been incorporated, and
tightened the check to verify the resulting buffer contents, suggested
by Wayne Davison]
Signed-off-by: Michal Rokos <michal.rokos@nextsoft.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Some systems (namely HPUX and Windows) return -1 when maxsize in snprintf()
and in vsnprintf() is reached. So replace snprintf() and vsnprintf()
functions with our own ones that return correct value upon overflow.
[jc: verified that review comments by J6t have been incorporated, and
tightened the check to verify the resulting buffer contents, suggested
by Wayne Davison]
Signed-off-by: Michal Rokos <michal.rokos@nextsoft.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Makefile | diff | blob | history | |
compat/snprintf.c | [new file with mode: 0644] | blob |
config.mak.in | diff | blob | history | |
configure.ac | diff | blob | history | |
git-compat-util.h | diff | blob | history |