Re: [Rd] use of buffers in sprintf and snprintf

2019-05-31 Thread Gábor Csárdi
On Fri, May 31, 2019 at 3:39 AM Henrik Bengtsson wrote: [...] > On MS Windows, there's actually a limit of 255 characters, cf. > http://www.aroma-project.org/howtos/UseLongFilenamesOnWindows/ > (disclaimer: I'm the author). Note particularly the comment at the > end: > > "Unfortunately it is not

Re: [Rd] use of buffers in sprintf and snprintf

2019-05-30 Thread Henrik Bengtsson
On Thu, May 30, 2019 at 7:21 PM Simon Urbanek wrote: > > No, that will make it even worse since you'll be declaring a lot more memory > that you actually have. > > The real problem is that you're ignoring the truncation, so you probably want > to use something like > > if (snprintf(tempname, siz

Re: [Rd] use of buffers in sprintf and snprintf

2019-05-30 Thread Simon Urbanek
No, that will make it even worse since you'll be declaring a lot more memory that you actually have. The real problem is that you're ignoring the truncation, so you probably want to use something like if (snprintf(tempname, sizeof(tempname), "%s.%d", of1name, j) >= sizeof(tempname)) Rf_error("

Re: [Rd] use of buffers in sprintf and snprintf

2019-05-30 Thread jing hua zhao
ith https://www.stats.ox.ac.uk/pub/bdr/gcc9/README.txt and those specification might as well used in --configure-args above. Besst regards, Jing Hua From: R-devel on behalf of jing hua zhao Sent: 29 May 2019 15:49 To: r-devel@r-project.org Subject: [Rd] use of buffers in s