Re: [PATCHES] Repleacement for src/port/snprintf.c
Kurt Roeckx <[email protected]>
| Newsgroups | gmane.comp.db.postgresql.devel.win32,gmane.comp.db.postgresql.devel.general,gmane.comp.db.postgresql.devel.patches |
|---|---|
| Message-ID | <[email protected]> |
On Mon, Feb 21, 2005 at 10:53:08PM -0500, Bruce Momjian wrote: > > Applied. The configure test is a little broken. It needs to quote the $'s. I've rewritten the test a little. Kurt ---------------------------(end of broadcast)--------------------------- TIP 1: subscribe and unsubscribe commands go to [email protected]
print.diff
(text/plain, 924 B)
Index: config/c-library.m4
===================================================================
RCS file: /projects/cvsroot/pgsql/config/c-library.m4,v
retrieving revision 1.30
diff -u -r1.30 c-library.m4
--- config/c-library.m4 22 Feb 2005 03:55:50 -0000 1.30
+++ config/c-library.m4 22 Feb 2005 18:53:23 -0000
@@ -279,19 +279,17 @@
[AC_MSG_CHECKING([printf supports argument control])
AC_CACHE_VAL(pgac_cv_printf_arg_control,
[AC_TRY_RUN([#include <stdio.h>
+#include <string.h>
-int does_printf_have_arg_control()
+int main()
{
char buf[100];
/* can it swap arguments? */
- snprintf(buf, 100, "%2$d|%1$d", 3, 4);
- if (strcmp(buf, "4|3") != 0)
- return 0;
- return 1;
-}
-main() {
- exit(! does_printf_have_arg_control());
+ snprintf(buf, 100, "%2\$d %1\$d", 3, 4);
+ if (strcmp(buf, "4 3") != 0)
+ return 1;
+ return 0;
}],
[pgac_cv_printf_arg_control=yes],
[pgac_cv_printf_arg_control=no],