This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/17829] New: Incorrect handling of precision specifier in printf family
- From: "nfxjfg at googlemail dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Mon, 12 Jan 2015 04:32:47 +0000
- Subject: [Bug libc/17829] New: Incorrect handling of precision specifier in printf family
- Auto-submitted: auto-generated
https://sourceware.org/bugzilla/show_bug.cgi?id=17829
Bug ID: 17829
Summary: Incorrect handling of precision specifier in printf
family
Product: glibc
Version: 2.19
Status: NEW
Severity: critical
Priority: P2
Component: libc
Assignee: unassigned at sourceware dot org
Reporter: nfxjfg at googlemail dot com
CC: drepper.fsp at gmail dot com
The following program shows no output:
#include <stdio.h>
#include <limits.h>
int main(int argc, char **argv)
{
printf("%.*s\n", INT_MAX, "hi");
return 0;
}
The precision given is INT_MAX; this should turn the precision specifier into a
no-OP, equivalent to 'printf("%s\n", "hi");'. Making the precision value
somewhat lower seems to make it work.
snprintf() seems to have a similar issue, but the failure seems to start with
even lower precision values.
Other libcs handle this correctly (I tested mingw-w64 and musl).
Using glibc 2.19-13 on Debian 32 bit x86.
--
You are receiving this mail because:
You are on the CC list for the bug.