diff options
author | joseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d> | 2012-10-10 15:35:46 +0000 |
---|---|---|
committer | joseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d> | 2012-10-10 15:35:46 +0000 |
commit | 2d32c4f00084f68a390e8fa4291acb49e9c0df8e (patch) | |
tree | 00964019e9307917f730b8c6b817f0cb9496a167 /libc/stdio-common/tst-sprintf.c | |
parent | 7dfcd4332472afda13e2ea9c0eaba15a08d8351e (diff) | |
download | eglibc2-2d32c4f00084f68a390e8fa4291acb49e9c0df8e.tar.gz |
Merge changes between r20863 and r21108 from /fsf/trunk.
git-svn-id: svn://svn.eglibc.org/trunk@21109 7b3dc134-2b1b-0410-93df-9e9f96275f8d
Diffstat (limited to 'libc/stdio-common/tst-sprintf.c')
-rw-r--r-- | libc/stdio-common/tst-sprintf.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libc/stdio-common/tst-sprintf.c b/libc/stdio-common/tst-sprintf.c index bfa79c9cc..42159a26f 100644 --- a/libc/stdio-common/tst-sprintf.c +++ b/libc/stdio-common/tst-sprintf.c @@ -1,5 +1,6 @@ #include <stdio.h> #include <stdlib.h> +#include <locale.h> #include <string.h> #include <gnu/option-groups.h> @@ -61,5 +62,17 @@ main (void) result = 1; } + if (setlocale (LC_ALL, "de_DE.UTF-8") == NULL) + { + puts ("cannot set locale"); + result = 1; + } + else if (sprintf (buf, "%.8s\n", "Foo: \277") != 7 + || strcmp (buf, "Foo: \277\n") != 0) + { + printf ("sprintf (buf, \"%%.8s\\n\", \"Foo: \\277\") produced '%s' output\n", buf); + result = 1; + } + return result; } |