Created attachment 1365 [details]
PATCH to fix the format string causing this bug.
For named vectors with long names, it is possible to make R print truncated/erroneous values for numeric and integer vectors.
For example, this 3-line snippet illustrates the bug :
x <- c(255, 1000, 30000)
names(x) <- list(paste(rep("a", 1002), collapse=""),
paste(rep("b", 1002), collapse=""),
paste(rep("c", 1002), collapse=""))
The strings of the list values are built by format strings with widths set according to the width of the names, but then they are used with snprintf limited to a hardcoded 1000 byte constant, NB. The format specifier widths should use the minimum of this constant -1 or the width of the names to fix the bug. Patch attached, or available from :
system x86_64, linux-gnu
status Under development (unstable)
svn rev 60410
version.string R Under development (unstable) (2012-08-24 r60410)
nickname Unsuffered Consequences
Thank you very much for the simple reproducible example and the patch.
Applied that and added a regression test, basically from your example.
(spam comment removed)