Skip to content
Prev 22198 / 63424 Next

Possible bug in Rcons_vprintf

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

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


Jeff