diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2014-11-06 11:08:14 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2014-11-06 11:08:14 +0000 |
commit | 97e2f27aa1c50d7ecb37314f912f7510d3ede879 (patch) | |
tree | f6b1fceb488c9f1e1714b447e216caaeddd0e2ec /newlib/testsuite | |
parent | 3a4fcef804dac80dba686a793fdc8b96be6a54e6 (diff) | |
download | cygnal-97e2f27aa1c50d7ecb37314f912f7510d3ede879.tar.gz cygnal-97e2f27aa1c50d7ecb37314f912f7510d3ede879.tar.bz2 cygnal-97e2f27aa1c50d7ecb37314f912f7510d3ede879.zip |
* libc/stdio/nano-vfprintf_i.c (_printf_i): Use Newlib approach to
handle string that might be not nul-terminated.
* testsuite/newlib.stdio/nulprintf.c: New test.
Diffstat (limited to 'newlib/testsuite')
-rw-r--r-- | newlib/testsuite/newlib.stdio/nulprintf.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/newlib/testsuite/newlib.stdio/nulprintf.c b/newlib/testsuite/newlib.stdio/nulprintf.c new file mode 100644 index 000000000..5e4131bc4 --- /dev/null +++ b/newlib/testsuite/newlib.stdio/nulprintf.c @@ -0,0 +1,17 @@ +/* + * Copyright (C) 2014 by ARM Ltd. All rights reserved. + * + * Permission to use, copy, modify, and distribute this software + * is freely granted, provided that this notice is preserved. + */ + +#include <stdio.h> +#include "check.h" + +const char m[8] = {'M','M','M','M','M','M','M','M'}; + +int main() +{ + printf ("%.*s\n", 8, m); + exit (0); +} |