diff options
author | Ulrich Drepper <drepper@redhat.com> | 1999-05-07 11:32:00 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 1999-05-07 11:32:00 +0000 |
commit | 31c46cf53db2849e7318fc0ee3418ef909c69466 (patch) | |
tree | 43f4987c65cb0bf568b455f805c871241d0f9e5b | |
parent | 7bcaca4384ad7234926730e9e2d90dae67d521bb (diff) | |
download | glibc-31c46cf53db2849e7318fc0ee3418ef909c69466.tar.gz glibc-31c46cf53db2849e7318fc0ee3418ef909c69466.tar.xz glibc-31c46cf53db2849e7318fc0ee3418ef909c69466.zip |
Update.
1999-05-07 Ulrich Drepper <drepper@cygnus.com> * stdio-common/tst-printf.c: Add test case for last _itoa problem. * stdio-common/vfprintf.c: Fix typo.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | stdio-common/tst-printf.c | 25 | ||||
-rw-r--r-- | stdio-common/vfprintf.c | 2 |
3 files changed, 27 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog index 06de3f1da6..1dbd5e9d1c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +1999-05-07 Ulrich Drepper <drepper@cygnus.com> + + * stdio-common/tst-printf.c: Add test case for last _itoa problem. + + * stdio-common/vfprintf.c: Fix typo. + 1999-05-06 Ulrich Drepper <drepper@cygnus.com> * elf/link.h (struct link_map): New field l_phdr_allocated. diff --git a/stdio-common/tst-printf.c b/stdio-common/tst-printf.c index 884e19f52a..c50c882028 100644 --- a/stdio-common/tst-printf.c +++ b/stdio-common/tst-printf.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 92, 93, 95, 96, 97, 98 Free Software Foundation, Inc. +/* Copyright (C) 1991,92,93,95,96,97,98,99 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -132,6 +132,7 @@ main (int argc, char *argv[]) static char shortstr[] = "Hi, Z."; static char longstr[] = "Good morning, Doctor Chandra. This is Hal. \ I am ready for my first lesson today."; + int result = 0; fmtchk("%.4x"); fmtchk("%04x"); @@ -237,16 +238,30 @@ I am ready for my first lesson today."; { char buf[200]; - int result; sprintf(buf,"%*s%*s%*s",-1,"one",-20,"two",-30,"three"); - result = strcmp (buf, - "onetwo three "); + result |= strcmp (buf, + "onetwo three "); puts (result != 0 ? "Test failed!" : "Test ok."); - return result != 0; } + + { + char buf[200]; + + sprintf (buf, "%07Lo", 040000000000ll); + printf ("sprintf (buf, \"%%07Lo\", 040000000000ll) = %s\n", buf); + + if (strcmp (buf, "40000000000") != 0) + { + result = 1; + fputs ("\tFAILED", stdout); + } + puts (""); + } + + return result != 0; } void diff --git a/stdio-common/vfprintf.c b/stdio-common/vfprintf.c index b61b637af9..263b0238c7 100644 --- a/stdio-common/vfprintf.c +++ b/stdio-common/vfprintf.c @@ -597,7 +597,7 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap) string = group_number (string, workend, grouping, \ thousands_sep); \ } \ - /* Simply further test for num != 0. */ \ + /* Simplify further test for num != 0. */ \ number.word = number.longlong != 0; \ } \ else \ |