Bug 255

Summary: printf() field width limit is unacceptable
Product: uClibc Reporter: Michael Deutschmann <michael>
Component: stdioAssignee: unassigned
Status: RESOLVED FIXED    
Severity: normal CC: uclibc-cvs
Priority: P5    
Version: 0.9.30.1   
Target Milestone: 0.9.31   
Hardware: PC   
OS: Linux   
Host: i386-pc-linux-uclibc Target: i386-pc-linux-uclibc
Build: i386-pc-linux-uclibc
Attachments: Patch to remove stdio field width cap
aforementioned widthtest.c

Description Michael Deutschmann 2009-03-31 05:18:34 UTC
Created attachment 219 [details]
Patch to remove stdio field width cap

uClibc mishandles printf field width limits larger than 40959, as a result of misguided overflow-protection code.  This causes spurious test failures with GNU coreutils, which depends on "%65536s" and "%20000000f" working according to spec.

I'm including a simple patch to fix the problem, extending the limit to INT_MAX.

When I reported this earlier in the old bug-tracking system, I was asked for a test program.  I've posted one on:

ftp://ftp.ocis.net/pub/users/ldeutsch/uCpatches/widthtest.c
Comment 1 Bernhard Reutner-Fischer 2009-07-21 17:38:37 UTC
Created attachment 489 [details]
aforementioned widthtest.c
Comment 2 Bernhard Reutner-Fischer 2010-03-17 15:47:58 UTC
applied as 266aaaf46e136d63532a797fd8604e30d4350443
Thanks!