diff options
author | Tobias Stoeckmann <tobias@cvs.openbsd.org> | 2008-02-11 20:33:12 +0000 |
---|---|---|
committer | Tobias Stoeckmann <tobias@cvs.openbsd.org> | 2008-02-11 20:33:12 +0000 |
commit | 404f1dc875990e0ff79d51b87fd1348190ce5fc6 (patch) | |
tree | 8470ab7922bf4a506ca038230975e352745de5de /usr.bin/cvs/diff3.c | |
parent | e1a1163925c6ab56d029629de9c3bd8b72cb9555 (diff) |
Cleanup buf implementation:
* Don't check for NULL on buffer creation, because it calls fatal() when
something's wrong.
* All buffers are supposed to expand if there is no space left in them,
so zap flags as well.
* Remove code that is now dead.
OK joris@
> Inspired by a diff from Igor Zinovik about unchecked return value.
Diffstat (limited to 'usr.bin/cvs/diff3.c')
-rw-r--r-- | usr.bin/cvs/diff3.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/usr.bin/cvs/diff3.c b/usr.bin/cvs/diff3.c index 9c811594429..fa6a440fc45 100644 --- a/usr.bin/cvs/diff3.c +++ b/usr.bin/cvs/diff3.c @@ -1,4 +1,4 @@ -/* $OpenBSD: diff3.c,v 1.39 2007/09/17 10:07:21 tobias Exp $ */ +/* $OpenBSD: diff3.c,v 1.40 2008/02/11 20:33:11 tobias Exp $ */ /* * Copyright (C) Caldera International Inc. 2001-2002. @@ -72,7 +72,7 @@ static const char copyright[] = #ifndef lint static const char rcsid[] = - "$OpenBSD: diff3.c,v 1.39 2007/09/17 10:07:21 tobias Exp $"; + "$OpenBSD: diff3.c,v 1.40 2008/02/11 20:33:11 tobias Exp $"; #endif /* not lint */ #include <ctype.h> @@ -176,10 +176,10 @@ cvs_merge_file(struct cvs_file *cf, int verbose) rcsnum_tostr(cf->file_ent->ce_rev, r1, sizeof(r1)); rcsnum_tostr(cf->file_rcsrev, r2, sizeof(r2)); - b1 = cvs_buf_load_fd(cf->fd, BUF_AUTOEXT); - d1 = cvs_buf_alloc((size_t)128, BUF_AUTOEXT); - d2 = cvs_buf_alloc((size_t)128, BUF_AUTOEXT); - diffb = cvs_buf_alloc((size_t)128, BUF_AUTOEXT); + b1 = cvs_buf_load_fd(cf->fd); + d1 = cvs_buf_alloc(128); + d2 = cvs_buf_alloc(128); + diffb = cvs_buf_alloc(128); (void)close(cf->fd); cf->fd = open(cf->file_path, O_WRONLY | O_TRUNC); |