Re: [Plplot-devel] Fix for 79-character truncation on plgfnam

2010-12-19 Thread David MacMahon
On Dec 19, 2010, at 1:09 PM, Alan W. Irwin wrote: > Dave, do you see any downsides > to the above idea as I have fleshed it out? Only the ones I outlined earlier in this thread... On Dec 18, 2010, at 11:34 AM, David MacMahon wrote: > I think automatic allocation by the library function, while

Re: [Plplot-devel] Fix for 79-character truncation on plgfnam

2010-12-19 Thread Alan W. Irwin
Hi Dave (with a question for Andrew at the end): > On Dec 18, 2010, at 6:30 PM, Alan W. Irwin wrote: >> With plgnfnam that would be changed to something like >> >> (needed_size, fnam) = plgnfnam(100) >> if needed_size >= 100: >> # Oops, 100 was too small. >> fname = plgnfnam(needed_size+1)[1] >

Re: [Plplot-devel] Fix for 79-character truncation on plgfnam

2010-12-18 Thread David MacMahon
On Dec 18, 2010, at 6:30 PM, Alan W. Irwin wrote: > On 2010-12-18 11:34-0800 David MacMahon wrote: > >> Am I missing something? > > See their example 1d where they check for truncation. Instead of > taking an error return at that point as they did in their sample code > the user could instead

Re: [Plplot-devel] Fix for 79-character truncation on plgfnam

2010-12-18 Thread Alan W. Irwin
On 2010-12-18 11:34-0800 David MacMahon wrote: > Hi, Alan, > > On Dec 18, 2010, at 10:57 AM, Alan W. Irwin wrote: > >> Another model for plgnver, plgndev, and plgnfnam is one similar to >> strlcpy that is discussed by Todd C. Miller and Theo de Raadt at >> http://www.gratisoft.us/todd/papers/strlc

Re: [Plplot-devel] Fix for 79-character truncation on plgfnam

2010-12-18 Thread David MacMahon
Hi, Alan, On Dec 18, 2010, at 10:57 AM, Alan W. Irwin wrote: > Another model for plgnver, plgndev, and plgnfnam is one similar to > strlcpy that is discussed by Todd C. Miller and Theo de Raadt at > http://www.gratisoft.us/todd/papers/strlcpy.html. That is a most > interesting paper to read. I

Re: [Plplot-devel] Fix for 79-character truncation on plgfnam

2010-12-18 Thread Alan W. Irwin
Hi Andrew (with one question for Dave): Thanks for contributing to this discussion. On 2010-12-18 13:59- Andrew Ross wrote: > I think passing a buffer size is the safest way to go. If you wanted a > constant buffer length, then it should be PATH_MAX to ensure any path > will fit, but this st

Re: [Plplot-devel] Fix for 79-character truncation on plgfnam

2010-12-18 Thread Andrew Ross
On Fri, Dec 17, 2010 at 10:53:44AM -0800, Alan Irwin wrote: > On 2010-12-16 21:15-0800 David MacMahon wrote: > > > Hi, Alan, > > > > On Dec 16, 2010, at 6:54 PM, Alan W. Irwin wrote: > > > >> Here is what I propose instead of this temporary measure. We go with > >> a backward-incompatible API cha

Re: [Plplot-devel] Fix for 79-character truncation on plgfnam

2010-12-17 Thread Alan W. Irwin
On 2010-12-16 21:15-0800 David MacMahon wrote: > Hi, Alan, > > On Dec 16, 2010, at 6:54 PM, Alan W. Irwin wrote: > >> Here is what I propose instead of this temporary measure. We go with >> a backward-incompatible API change (and associated soname bump to >> force everybody to recompile) of >> >>

Re: [Plplot-devel] Fix for 79-character truncation on plgfnam

2010-12-16 Thread David MacMahon
Hi, Alan, On Dec 16, 2010, at 6:54 PM, Alan W. Irwin wrote: > Here is what I propose instead of this temporary measure. We go with > a backward-incompatible API change (and associated soname bump to > force everybody to recompile) of > > c_plgfnam( char *fnam ); ==> c_plgfnam( char *fnam, PLINT

[Plplot-devel] Fix for 79-character truncation on plgfnam

2010-12-16 Thread Alan W. Irwin
Andrew, I would very much appreciate your and other PLplot API expert's comments on this issue. I noticed during some of my generic testing today that the output file name was truncated for the 31st example at the 79th character. This seems to be a rather tight limit for today's computers where f