Re: [Rd] [R] Errors in "An introduction to R"

2023-07-12 Thread Jarkko Toivonen

Hi all,

I originally sent my correction suggestions to R-help list since the
R-intro document contains the following sentence:
"Comments and corrections are always welcome. Please address email 
correspondence to

r-h...@r-project.org."

Maybe that email address needs updating as well.

Jarkko

On 11.7.2023 11.53, Martin Maechler wrote:

Ivan Krylov
 on Mon, 10 Jul 2023 18:37:30 +0300 writes:

 > Dear Jarkko, Thank you for spotting these problems and
 > suggesting fixes for them! I am forwarding your e-mail to
 > the R-devel mailing list (removing the R-help list, which
 > is for different kind of R problems), together with a
 > patch implementing your suggested changes.


Thank you, both, Jarkko  and Ivan for your respective work!
I've committed the changes from Ivan's patch to the sources.


 > В Thu, 6 Jul 2023 10:12:16 +0300 Jarkko Toivonen
 >  пишет:
 >> I noticed a few errors in Version 4.3.1 (2023-06-16)

 > --- doc/manual/R-intro.texi (revision 84676)
 > +++ doc/manual/R-intro.texi (working copy)

   [...]
   [...]

 > I chose to replace the "working directory" metaphor with
 > "workspace". I such word use here is correct.

In other parts of the R-intro the  "working directory" actually
has been correct use (not even metaphoric).

 > --
 > Best regards, Ivan

Thank you again,
Martin


__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] Incorrect type in malloc in Rscript.c

2023-07-12 Thread Will McClennan
I downloaded and compiled R-4.3.1 from cran.rstudio.com and on line 405 of 
Rscript.c in src/unix the line of code

char *buf=(char*) malloc((size_t) (len+1)*sizeof(char *));

appears to be wrong to me. If an array of char* is being allocated then the 
argument to sizeof should be char and not char*. On a 64 bit machine this will 
allocate 8 times as much memory as needed. For this reason the code works but 
it is an incorrect. Not a big issue though.

Will McClennan
__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Incorrect type in malloc in Rscript.c

2023-07-12 Thread Tomas Kalibera



On 7/13/23 00:26, Will McClennan wrote:

I downloaded and compiled R-4.3.1 from cran.rstudio.com and on line 405 of 
Rscript.c in src/unix the line of code

char *buf=(char*) malloc((size_t) (len+1)*sizeof(char *));

appears to be wrong to me. If an array of char* is being allocated then the 
argument to sizeof should be char and not char*. On a 64 bit machine this will 
allocate 8 times as much memory as needed. For this reason the code works but 
it is an incorrect. Not a big issue though.


Thanks, fixed now.

Tomas



Will McClennan
__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel