summaryrefslogtreecommitdiff
path: root/usr.bin/patch/patch.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2003-07-22 20:48:59 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2003-07-22 20:48:59 +0000
commita2f01ba78f9658298ec375a117dfeed77c37ef15 (patch)
tree314a55b849a5a838205aac4cf0e86847b4186259 /usr.bin/patch/patch.c
parent3d92e59274e0a2d3343a9b936de7fbad28cb20f3 (diff)
Make rejname[] static to patch.c and crank its size to NAME_MAX+1
Diffstat (limited to 'usr.bin/patch/patch.c')
-rw-r--r--usr.bin/patch/patch.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/usr.bin/patch/patch.c b/usr.bin/patch/patch.c
index 01b1ee0bd99..8095625113f 100644
--- a/usr.bin/patch/patch.c
+++ b/usr.bin/patch/patch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: patch.c,v 1.24 2003/07/22 20:17:06 millert Exp $ */
+/* $OpenBSD: patch.c,v 1.25 2003/07/22 20:48:58 millert Exp $ */
/*
* patch - a program to apply diffs to original files
@@ -27,7 +27,7 @@
*/
#ifndef lint
-static const char rcsid[] = "$OpenBSD: patch.c,v 1.24 2003/07/22 20:17:06 millert Exp $";
+static const char rcsid[] = "$OpenBSD: patch.c,v 1.25 2003/07/22 20:48:58 millert Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -37,6 +37,7 @@ static const char rcsid[] = "$OpenBSD: patch.c,v 1.24 2003/07/22 20:17:06 miller
#include <assert.h>
#include <ctype.h>
#include <getopt.h>
+#include <limits.h>
#include <string.h>
#include <stdlib.h>
@@ -69,9 +70,13 @@ static int remove_empty_files = FALSE;
/* TRUE if -R was specified on command line. */
static int reverse_flag_specified = FALSE;
- /* buffer for stderr */
+/* buffer holding the name of the rejected patch file. */
+static char rejname[NAME_MAX + 1];
+
+/* buffer for stderr */
static char serrbuf[BUFSIZ];
+
/* Apply a set of diffs as appropriate. */
int