SecBSD's official ports repository

This commit is contained in:
purplerain 2023-08-16 22:26:55 +00:00
commit 2c0afcbbf3
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
64331 changed files with 5339189 additions and 0 deletions

View file

@ -0,0 +1,34 @@
--- src/plotone.c.orig Wed Feb 27 21:29:56 2002
+++ src/plotone.c Mon Aug 26 11:11:08 2002
@@ -113,7 +113,7 @@ void do_hardcopy(void)
char fname[GR_MAXPATHLEN];
view v;
double vx, vy;
- int truncated_out;
+ int truncated_out, fd;
if (get_ptofile()) {
if (print_file[0] == '\0') {
@@ -127,12 +127,19 @@ void do_hardcopy(void)
errmsg("No print command defined, output aborted");
return;
}
- tmpnam(fname);
+
/* VMS doesn't like extensionless files */
- strcat(fname, ".prn");
+ strlcpy(fname, P_tmpdir, sizeof fname);
+ strlcat(fname, "grace-XXXXXXXXXX.prn", sizeof fname);
+ fd = mkstemps(fname, 4);
+ if (fd == -1) {
+ errmsg("Could not create tmp file.");
+ return;
+ } else
+ close(fd);
}
- prstream = grace_openw(fname);
+ prstream = filter_write(fname);
if (prstream == NULL) {
return;