summary refs log tree commit diff
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2016-09-09 19:41:36 +0200
committerChristian Neukirchen <chneukirchen@gmail.com>2016-09-09 19:41:36 +0200
commit947c1f5ffaef0e77137486442be480874ff1fb1c (patch)
tree0134abf4df467128f58d36aa723f6df115a69def
parent7f10780b02facac69c6bc3c9a652f7809a0285b3 (diff)
downloadoutils-947c1f5ffaef0e77137486442be480874ff1fb1c.tar.gz
outils-947c1f5ffaef0e77137486442be480874ff1fb1c.tar.xz
outils-947c1f5ffaef0e77137486442be480874ff1fb1c.zip
cvs update
-rw-r--r--src/usr.bin/signify/zsig.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/usr.bin/signify/zsig.c b/src/usr.bin/signify/zsig.c
index 3611f28..4abe30a 100644
--- a/src/usr.bin/signify/zsig.c
+++ b/src/usr.bin/signify/zsig.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: zsig.c,v 1.10 2016/09/04 17:00:22 espie Exp $ */
+/* $OpenBSD: zsig.c,v 1.11 2016/09/08 16:04:01 espie Exp $ */
 /*
  * Copyright (c) 2016 Marc Espie <espie@openbsd.org>
  *
@@ -150,15 +150,9 @@ copy_blocks(int fdout, int fdin, const char *sha, const char *endsha,
 		if (residual != bufend) {
 			/* how much can we copy */
 			size_t len = bufend - residual;
-			if (len >= bufsize) {
-				memcpy(buffer, residual, bufsize);
-				n = bufsize;
-				residual += bufsize;
-			} else {
-				memcpy(buffer, residual, len);
-				residual += len;
-				n = len;
-			}
+			n = len >= bufsize ? bufsize : len;
+			memcpy(buffer, residual, n);
+			residual += n;
 		}
 		/* if we're not done yet, try to obtain more until EOF */
 		while (n != bufsize) {