From c4582f93a263bea534288e7f7ad8937405964cd4 Mon Sep 17 00:00:00 2001 From: Michal Rokos Date: Wed, 5 Mar 2008 16:46:13 +0100 Subject: 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 Signed-off-by: Junio C Hamano --- config.mak.in | 1 + 1 file changed, 1 insertion(+) (limited to 'config.mak.in') diff --git a/config.mak.in b/config.mak.in index ee6c33df03..8e1cd5f03d 100644 --- a/config.mak.in +++ b/config.mak.in @@ -46,3 +46,4 @@ NO_MKDTEMP=@NO_MKDTEMP@ NO_ICONV=@NO_ICONV@ OLD_ICONV=@OLD_ICONV@ NO_DEFLATE_BOUND=@NO_DEFLATE_BOUND@ +SNPRINTF_RETURNS_BOGUS=@SNPRINTF_RETURNS_BOGUS@ -- cgit v1.2.3