strftime: don't assume a byte count fits in 'int'
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 21 Mar 2011 06:59:29 +0000 (23:59 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 21 Mar 2011 07:00:28 +0000 (00:00 -0700)
commit0ed06c55c442f0ef2ba1ac32b8420bb595c0b98d
tree21e1f8460d33f60f85287d1e860f9550a1075a84
parent947308101bb178ddac8f958bab94d20bdee4fd3b
strftime: don't assume a byte count fits in 'int'

* lib/strftime.c (add): Don't assume first arg fits in 'int'.  I
found this problem by static analysis, using gcc -Wstrict-overflow
(GCC 4.5.2, x86-64).  This reported an optimization that depended
on an integer overflow having undefined behavior, but it turns out
that the argument is a size, which might not fit in 'int' anyway,

2011-03-20  Paul Eggert  <eggert@cs.ucla.edu>
ChangeLog
lib/strftime.c