Index: unix/sys-unix.c =================================================================== --- unix/sys-unix.c (revision 51208) +++ unix/sys-unix.c (working copy) @@ -61,7 +61,7 @@ attribute_hidden FILE *R_OpenInitFile(void) { - char buf[256], *home, *p = getenv("R_PROFILE_USER"); + char buf[PATH_MAX], *home, *p = getenv("R_PROFILE_USER"); FILE *fp; fp = NULL; @@ -72,7 +72,7 @@ return fp; if((home = getenv("HOME")) == NULL) return NULL; - sprintf(buf, "%s/.Rprofile", home); + snprintf(buf, PATH_MAX, "%s/.Rprofile", home); if((fp = R_fopen(buf, "r"))) return fp; } Index: main/startup.c =================================================================== --- main/startup.c (revision 51208) +++ main/startup.c (working copy) @@ -52,10 +52,10 @@ attribute_hidden FILE *R_OpenLibraryFile(const char *file) { - char buf[256]; + char buf[PATH_MAX]; FILE *fp; - snprintf(buf, 256, "%s/library/base/R/%s", R_Home, file); + snprintf(buf, PATH_MAX, "%s/library/base/R/%s", R_Home, file); fp = R_fopen(buf, "r"); return fp; } @@ -71,10 +71,10 @@ attribute_hidden FILE *R_OpenSysInitFile(void) { - char buf[256]; + char buf[PATH_MAX]; FILE *fp; - snprintf(buf, 256, "%s/library/base/R/Rprofile", R_Home); + snprintf(buf, PATH_MAX, "%s/library/base/R/Rprofile", R_Home); fp = R_fopen(buf, "r"); return fp; } @@ -82,7 +82,7 @@ attribute_hidden FILE *R_OpenSiteFile(void) { - char buf[256]; + char buf[PATH_MAX]; FILE *fp; fp = NULL; @@ -91,10 +91,10 @@ return fp; if ((fp = R_fopen(getenv("RPROFILE"), "r"))) return fp; - snprintf(buf, 256, "%s/etc/Rprofile.site", R_Home); + snprintf(buf, PATH_MAX, "%s/etc/Rprofile.site", R_Home); if ((fp = R_fopen(buf, "r"))) return fp; - /* snprintf(buf, 256, "%s/etc/Rprofile", R_Home); + /* snprintf(buf, PATH_MAX, "%s/etc/Rprofile", R_Home); if ((fp = R_fopen(buf, "r"))) return fp; */ } Index: main/main.c =================================================================== --- main/main.c (revision 51208) +++ main/main.c (working copy) @@ -862,9 +862,9 @@ } if (strcmp(R_GUIType, "Tk") == 0) { - char buf[256]; + char buf[PATH_MAX]; - snprintf(buf, 256, "%s/library/tcltk/exec/Tk-frontend.R", R_Home); + snprintf(buf, PATH_MAX, "%s/library/tcltk/exec/Tk-frontend.R", R_Home); R_LoadProfile(R_fopen(buf, "r"), R_GlobalEnv); }