summaryrefslogtreecommitdiffstats
path: root/usr.bin/cvs/diff3.c
diff options
context:
space:
mode:
authortobias <tobias@openbsd.org>2007-09-10 14:29:53 +0000
committertobias <tobias@openbsd.org>2007-09-10 14:29:53 +0000
commita52c79cd89b98bad71f1be2d3c15f4f5e57120b6 (patch)
treeff8409067e933072693b0dea0f1eff8be45c72ef /usr.bin/cvs/diff3.c
parentAllow port specification in our CVSROOT which is used for our (diff)
downloadwireguard-openbsd-a52c79cd89b98bad71f1be2d3c15f4f5e57120b6.tar.xz
wireguard-openbsd-a52c79cd89b98bad71f1be2d3c15f4f5e57120b6.zip
Proper use of fseek/fseeko macros.
OK joris@, otto@
Diffstat (limited to 'usr.bin/cvs/diff3.c')
-rw-r--r--usr.bin/cvs/diff3.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/usr.bin/cvs/diff3.c b/usr.bin/cvs/diff3.c
index 742cd2ccc3e..3f05e815907 100644
--- a/usr.bin/cvs/diff3.c
+++ b/usr.bin/cvs/diff3.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: diff3.c,v 1.37 2007/06/28 21:38:09 xsa Exp $ */
+/* $OpenBSD: diff3.c,v 1.38 2007/09/10 14:29:53 tobias Exp $ */
/*
* Copyright (C) Caldera International Inc. 2001-2002.
@@ -72,12 +72,13 @@ static const char copyright[] =
#ifndef lint
static const char rcsid[] =
- "$OpenBSD: diff3.c,v 1.37 2007/06/28 21:38:09 xsa Exp $";
+ "$OpenBSD: diff3.c,v 1.38 2007/09/10 14:29:53 tobias Exp $";
#endif /* not lint */
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
+#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
@@ -729,7 +730,7 @@ repos(int nchar)
int i;
for (i = 0; i < 2; i++)
- (void)fseek(fp[i], (long)-nchar, 1);
+ (void)fseek(fp[i], (long)-nchar, SEEK_CUR);
}
/*
@@ -763,7 +764,7 @@ edscript(int n)
prange(&de[n].old);
else
diff_output("%da\n=======\n", de[n].old.to -1);
- (void)fseek(fp[2], (long)de[n].new.from, 0);
+ (void)fseek(fp[2], (long)de[n].new.from, SEEK_SET);
for (k = de[n].new.to-de[n].new.from; k > 0; k-= j) {
j = k > BUFSIZ ? BUFSIZ : k;
if (fread(block, (size_t)1, (size_t)j,