about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2005-07-21 09:33:53 +0000
committerJakub Jelinek <jakub@redhat.com>2005-07-21 09:33:53 +0000
commitc6dd3473c618260352d280a829d88695d9e2ae23 (patch)
tree73954204ef93da3335a9d3344c0367dfe6004bb4
parent736e2ab430e006ba09a2fe34d7887d3812ac808f (diff)
downloadglibc-c6dd3473c618260352d280a829d88695d9e2ae23.tar.gz
glibc-c6dd3473c618260352d280a829d88695d9e2ae23.tar.xz
glibc-c6dd3473c618260352d280a829d88695d9e2ae23.zip
* wcsmbs/bits/wchar2.h (swprintf): Remove format argument.
	* debug/tst-chk1.c (do_test): Add test for swprintf with format
	being the last argument.
-rw-r--r--ChangeLog6
-rw-r--r--debug/tst-chk1.c4
-rw-r--r--wcsmbs/bits/wchar2.h7
3 files changed, 13 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 9f8bfa838b..01dd07a0b7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2005-07-21  Jakub Jelinek  <jakub@redhat.com>
+
+	* wcsmbs/bits/wchar2.h (swprintf): Remove format argument.
+	* debug/tst-chk1.c (do_test): Add test for swprintf with format
+	being the last argument.
+
 2005-07-20  Ulrich Drepper  <drepper@redhat.com>
 
 	* sysdeps/x86_64/fpu/libm-test-ulps: Adjust expected atan2f results.
diff --git a/debug/tst-chk1.c b/debug/tst-chk1.c
index f444a14c2a..c22c2e8fc2 100644
--- a/debug/tst-chk1.c
+++ b/debug/tst-chk1.c
@@ -406,6 +406,10 @@ do_test (void)
       || wmemcmp (wbuf, L"aabcEDX98", 10))
     FAIL ();
 
+  if (swprintf (wbuf + 7, 3, L"64") != 2
+      || wmemcmp (wbuf, L"aabcEDX64", 10))
+    FAIL ();
+
   /* These ops need runtime checking, but shouldn't __chk_fail.  */
   wmemcpy (wbuf, L"abcdefghij", l0 + 10);
   wmemmove (wbuf + 1, wbuf, l0 + 9);
diff --git a/wcsmbs/bits/wchar2.h b/wcsmbs/bits/wchar2.h
index c102948f11..8dd5b88014 100644
--- a/wcsmbs/bits/wchar2.h
+++ b/wcsmbs/bits/wchar2.h
@@ -199,11 +199,10 @@ extern int __swprintf_chk (wchar_t *__restrict __s, size_t __n,
      __THROW /* __attribute__ ((__format__ (__wprintf__, 5, 6))) */;
 
 /* XXX We might want to have support in gcc for swprintf.  */
-#define swprintf(s, n, format, ...) \
+#define swprintf(s, n, ...) \
   (__bos (s) != (size_t) -1 || __USE_FORTIFY_LEVEL > 1			      \
-   ? __swprintf_chk (s, n, __USE_FORTIFY_LEVEL - 1, __bos (s), format,	      \
-		     __VA_ARGS__)					      \
-   : swprintf (s, n, format, __VA_ARGS__))
+   ? __swprintf_chk (s, n, __USE_FORTIFY_LEVEL - 1, __bos (s), __VA_ARGS__)   \
+   : swprintf (s, n, __VA_ARGS__))
 
 
 extern int __vswprintf_chk (wchar_t *__restrict __s, size_t __n,