[Rd] Possible bug in Rcons_vprintf

Martin Maechler maechler at stat.math.ethz.ch
Sat Sep 30 16:36:30 CEST 2006


Thanks, Jeffrey,

that (change) looks very logical, reasonable, ...
and I'll commit a patch to R-devel ASAP.

On the other hand, I'm currently not intending to port the fix
to the currently "deep frozen" R-2.4-branch [because "you never know ..."]
unless you can argue a bit more why the change seems important 
(or at least can demonstrate bogous behavior that is fixed by it).

Martin

>>>>> "Jeffrey" == Jeffrey Horner <jeff.horner at vanderbilt.edu>
>>>>>     on Fri, 29 Sep 2006 15:22:51 -0500 writes:

    Jeffrey> In R-2-4-branch r39548, Rcons_vprintf is called from stdout_vfprintf 
    Jeffrey> when R_Outputfile is NULL. When called and output is greater than 
    Jeffrey> R_BUFSIZE, output is truncated to R_BUFSIZE. Here's a one-line fix:

    Jeffrey> Index: src/main/printutils.c
    Jeffrey> ===================================================================
    Jeffrey> --- src/main/printutils.c       (revision 39548)
    Jeffrey> +++ src/main/printutils.c       (working copy)
    Jeffrey> @@ -638,7 +638,7 @@
    Jeffrey> res = R_BUFSIZE;
    Jeffrey> }
    Jeffrey> #endif /* HAVE_VA_COPY */
    Jeffrey> -    R_WriteConsole(p, strlen(buf));
    Jeffrey> +    R_WriteConsole(p, strlen(p));
    Jeffrey> #ifdef HAVE_VA_COPY
    Jeffrey> if(usedRalloc) vmaxset(vmax);
    Jeffrey> if(usedVasprintf) free(p);


    Jeffrey> Jeff
    Jeffrey> -- 
    Jeffrey> http://biostat.mc.vanderbilt.edu/JeffreyHorner




More information about the R-devel mailing list