diff options
author | Pav Lucistnik <pav@FreeBSD.org> | 2004-11-05 13:22:00 +0000 |
---|---|---|
committer | Pav Lucistnik <pav@FreeBSD.org> | 2004-11-05 13:22:00 +0000 |
commit | 52535f7cf0b607b0a4e645395d912df23b05cba0 (patch) | |
tree | 0bf117fe7dc6473c4f4827b3569d0fdaf213194b /print/mpage/files/patch-file_c | |
parent | Update to 3.12 (diff) |
- Update to 2.5.4
PR: ports/73470
Submitted by: KATO Tsuguru <tkato432@yahoo.com>
Notes
Notes:
svn path=/head/; revision=120864
Diffstat (limited to 'print/mpage/files/patch-file_c')
-rw-r--r-- | print/mpage/files/patch-file_c | 52 |
1 files changed, 25 insertions, 27 deletions
diff --git a/print/mpage/files/patch-file_c b/print/mpage/files/patch-file_c index d1838f88d6c2..725f8b09a8db 100644 --- a/print/mpage/files/patch-file_c +++ b/print/mpage/files/patch-file_c @@ -1,6 +1,5 @@ -$OpenBSD: patch-file_c,v 1.2 2002/11/13 17:15:49 naddy Exp $ ---- file.c.orig Sun Jun 16 02:56:44 2002 -+++ file.c Mon Nov 11 06:54:23 2002 +--- file.c.orig Mon May 31 04:34:15 2004 ++++ file.c Mon Nov 1 20:58:16 2004 @@ -18,6 +18,7 @@ */ @@ -9,41 +8,40 @@ $OpenBSD: patch-file_c,v 1.2 2002/11/13 17:15:49 naddy Exp $ #include "mpage.h" -@@ -101,10 +102,10 @@ do_pr_file(fname, asheet, outfd) - * header or not +@@ -119,11 +120,11 @@ */ + #define DASHES "-- " if (opt_header != NULL) -- (void)sprintf(command, "%s -l%d -w%d -h \"%s\" %s", prprog, -+ (void)snprintf(command, sizeof(command), "%s -l%d -w%d -h \"%s\" %s", prprog, - asheet->sh_plength, asheet->sh_cwidth, opt_header, fname); +- (void)sprintf(command, "%s -l%d -w%d -h \"%s\" %s%s", prprog, ++ (void)snprintf(command, sizeof(command), "%s -l%d -w%d -h \"%s\" %s%s", prprog, + asheet->sh_plength, asheet->sh_cwidth, opt_header, + fname[0] == '-' ? DASHES : "", fname); else -- (void)sprintf(command, "%s -l%d -w%d %s", prprog, -+ (void)snprintf(command, sizeof(command), "%s -l%d -w%d %s", prprog, - asheet->sh_plength, asheet->sh_cwidth, fname); +- (void)sprintf(command, "%s -l%d -w%d %s%s", prprog, ++ (void)snprintf(command, sizeof(command), "%s -l%d -w%d %s%s", prprog, + asheet->sh_plength, asheet->sh_cwidth, + fname[0] == '-' ? DASHES : "", fname); /* - * open a pipe to the proper pr(1) command, and pr provides -@@ -148,7 +149,7 @@ do_stdin(asheet, outfd) - * a temporary file; this temporary file will then - * be used as input to the do_doc routine - */ -- (void)strcpy(tmpfile, "/usr/tmp/mpageXXXXXX"); -+ (void)strlcpy(tmpfile, "/tmp/mpageXXXXXX", sizeof(tmpfile)); - if ( (tmpfd = mkstemp(tmpfile)) == -1) { - fprintf(stderr, "%s: cannot create temporary file", MPAGE); - perror(MPAGE); -@@ -156,11 +157,13 @@ do_stdin(asheet, outfd) +@@ -168,7 +169,7 @@ + * but the tmpfilename + */ + +- (void) strcpy(tmpfile, "/usr/tmp/mpage-stdin-XXXXXX"); ++ (void) strlcpy(tmpfile, "/tmp/mpage-stdin-XXXXXX", sizeof(tmpfile)); + if ( (tmpfd = mkstemp(tmpfile)) == -1) { + fprintf(stderr, "%s: cannot create temporary file", MPAGE); + perror(MPAGE); +@@ -217,11 +218,11 @@ } close(tmpfd); if (opt_header != NULL) -- (void)sprintf(command, "%s -l%d -w%d -h \"%s\"> %s", prprog, -+ (void)snprintf(command, sizeof(command), -+ "%s -l%d -w%d -h \"%s\"> %s", prprog, +- (void)sprintf(command, "%s -l%d -w%d -h \"%s\" > %s", prprog, ++ (void)snprintf(command, sizeof(command), "%s -l%d -w%d -h \"%s\" > %s", prprog, asheet->sh_plength, asheet->sh_cwidth, opt_header, tmpfile); else - (void)sprintf(command, "%s -l%d -w%d > %s", prprog, -+ (void)snprintf(command, sizeof(command), -+ "%s -l%d -w%d > %s", prprog, ++ (void)snprintf(command, sizeof(command), "%s -l%d -w%d > %s", prprog, asheet->sh_plength, asheet->sh_cwidth, tmpfile); /* * open a pipe to the pr(1) command which will create a |