summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--configure.ac16
-rw-r--r--openbsd-compat/bsd-snprintf.c4
3 files changed, 22 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index ef4f3c398..d28bdf5d6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,10 @@
120051217 120051217
2 - (dtucker) [defines.h] HP-UX system headers define "YES" and "NO" which 2 - (dtucker) [defines.h] HP-UX system headers define "YES" and "NO" which
3 scp.c also uses, so undef them here. 3 scp.c also uses, so undef them here.
4 - (dtucker) [configure.ac openbsd-compat/bsd-snprintf.c] Bug #1133: Our
5 snprintf replacement can have a conflicting declaration in HP-UX's system
6 headers (const vs. no const) so we now check for and work around it. Patch
7 from the dynamic duo of David Leonard and Ted Percival.
4 8
520051214 920051214
6 - (dtucker) OpenBSD CVS Sync (regress/) 10 - (dtucker) OpenBSD CVS Sync (regress/)
@@ -3462,4 +3466,4 @@
3462 - (djm) Trim deprecated options from INSTALL. Mention UsePAM 3466 - (djm) Trim deprecated options from INSTALL. Mention UsePAM
3463 - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu 3467 - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu
3464 3468
3465$Id: ChangeLog,v 1.4029 2005/12/17 11:04:08 dtucker Exp $ 3469$Id: ChangeLog,v 1.4030 2005/12/17 11:32:03 dtucker Exp $
diff --git a/configure.ac b/configure.ac
index 80daa0c23..df85e319f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
1# $Id: configure.ac,v 1.314 2005/12/13 09:44:13 djm Exp $ 1# $Id: configure.ac,v 1.315 2005/12/17 11:32:03 dtucker Exp $
2# 2#
3# Copyright (c) 1999-2004 Damien Miller 3# Copyright (c) 1999-2004 Damien Miller
4# 4#
@@ -1343,6 +1343,20 @@ int main(void)
1343 ) 1343 )
1344fi 1344fi
1345 1345
1346# On systems where [v]snprintf is broken, but is declared in stdio,
1347# check that the fmt argument is const char * or just char *.
1348# This is only useful for when BROKEN_SNPRINTF
1349AC_MSG_CHECKING([whether snprintf can declare const char *fmt])
1350AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <stdio.h>
1351 int snprintf(char *a, size_t b, const char *c, ...) { return 0; }
1352 int main(void) { snprintf(0, 0, 0); }
1353 ]])],
1354 [AC_MSG_RESULT(yes)
1355 AC_DEFINE(SNPRINTF_CONST, [const],
1356 [Define as const if snprintf() can declare const char *fmt])],
1357 [AC_MSG_RESULT(no)
1358 AC_DEFINE(SNPRINTF_CONST, [/* not const */])])
1359
1346# Check for missing getpeereid (or equiv) support 1360# Check for missing getpeereid (or equiv) support
1347NO_PEERCHECK="" 1361NO_PEERCHECK=""
1348if test "x$ac_cv_func_getpeereid" != "xyes" ; then 1362if test "x$ac_cv_func_getpeereid" != "xyes" ; then
diff --git a/openbsd-compat/bsd-snprintf.c b/openbsd-compat/bsd-snprintf.c
index ca275abdf..e4ba154fd 100644
--- a/openbsd-compat/bsd-snprintf.c
+++ b/openbsd-compat/bsd-snprintf.c
@@ -89,7 +89,7 @@
89 89
90#include "includes.h" 90#include "includes.h"
91 91
92RCSID("$Id: bsd-snprintf.c,v 1.10 2005/11/24 08:58:21 djm Exp $"); 92RCSID("$Id: bsd-snprintf.c,v 1.11 2005/12/17 11:32:04 dtucker Exp $");
93 93
94#if defined(BROKEN_SNPRINTF) /* For those with broken snprintf() */ 94#if defined(BROKEN_SNPRINTF) /* For those with broken snprintf() */
95# undef HAVE_SNPRINTF 95# undef HAVE_SNPRINTF
@@ -788,7 +788,7 @@ int vsnprintf (char *str, size_t count, const char *fmt, va_list args)
788#endif 788#endif
789 789
790#if !defined(HAVE_SNPRINTF) 790#if !defined(HAVE_SNPRINTF)
791int snprintf(char *str,size_t count,const char *fmt,...) 791int snprintf(char *str, size_t count, SNPRINTF_CONST char *fmt, ...)
792{ 792{
793 size_t ret; 793 size_t ret;
794 va_list ap; 794 va_list ap;