[Rd] %s in filename when opening device causes crash (PR#10571)

Richard Cotton Richard.Cotton at hsl.gov.uk
Wed Jan 16 11:32:23 CET 2008




Prof Brian Ripley wrote:
> 
>> Yes. The problem is of course that we do want a sprintf() format there
>> for "Rplot%03d.pdf" et al. One  option would be to escape "%" except
>> when in (regexp) "%[0-9]*d", which seems nontrivial, but not impossible.
> 
> But there are other integer formats (%i, %u, %x, %X), and other flags (# 
> might be useful).  So the list of valid inputs is also rather long.  It 
> would be tedious to do at C level, but a check in the R-level wrapper 
> would be easier (if not 'simple').
> 

Having just worked my way through the alphabet, I can say that it is only
the letters 's' and 'n' that cause any problems.  Thus, if you do decide to
handle the error in the R wrapper functions, the regex for bad inputs is
fairly straightforward "%[#[:blank:]\\+\\-]*[[:digit:]]*[sn]".
-- 
View this message in context: http://www.nabble.com/-s-in-filename-when-opening-device-causes-crash-%28PR-10571%29-tp14806982p14877649.html
Sent from the R devel mailing list archive at Nabble.com.



More information about the R-devel mailing list