libc6 printf "alternate format" %#.g prints wrong number of digits
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
GLibC |
Fix Released
|
Medium
|
|||
glibc (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: libc6
I used Ubuntu 7.04 on x86 system (Pentium M), and updated the libc package to version 2.6: (2.6-3ubuntu2). The error described below also appliled to glibc 2.5, IIRC.
I found that the following C program won't print the correct number of digits:
#include <stdio.h>
int main(int argc, char *argv[], char *env[])
{
printf(
return 0;
}
The output should be "913.0", but my Ubuntu box shows "913." (no trailing zero). The alternate format, according to the C standard, should print out the trailing zeros after decimal point.
This error is shameful and severe! I tried on different systems (Fedora 5, Fedora 6, SunOS, CentOS), none of them show this sickness.
Wirawan
Related branches
Changed in glibc: | |
status: | Unknown → Confirmed |
Changed in glibc: | |
status: | Confirmed → Fix Released |
Changed in glibc: | |
importance: | Unknown → Medium |
This, as it turns out, did not happen if we use libc.a in libc6-dev_ 2.5-0ubuntu14_ i386.deb . So what happens? Perhaps the patch was missing or wrong in the newer libc?
Wirawan