=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/signify/zsig.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- src/usr.bin/signify/zsig.c 2016/09/04 17:00:22 1.10 +++ src/usr.bin/signify/zsig.c 2016/09/08 16:04:01 1.11 @@ -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 * @@ -150,15 +150,9 @@ 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) {