Received: by mail.netbsd.org (Postfix, from userid 605) id 8C95284DE1; Thu, 18 Jun 2020 13:38:50 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id B422F84D66 for ; Thu, 18 Jun 2020 13:38:49 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([IPv6:::1]) by localhost (mail.netbsd.org [IPv6:::1]) (amavisd-new, port 10025) with ESMTP id hKjdZkU_wHyG for ; Thu, 18 Jun 2020 13:38:49 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.netbsd.org [199.233.217.197]) by mail.netbsd.org (Postfix) with ESMTP id 39A9384D21 for ; Thu, 18 Jun 2020 13:38:49 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id 378FAFB28; Thu, 18 Jun 2020 13:38:49 +0000 (UTC) Content-Transfer-Encoding: 7bit Content-Type: multipart/mixed; boundary="_----------=_159248752957980" MIME-Version: 1.0 Date: Thu, 18 Jun 2020 13:38:49 +0000 From: "Nathanial Sloss" Subject: CVS commit: pkgsrc/devel/diffbreaker/files/diffbreaker To: pkgsrc-changes@NetBSD.org Reply-To: nat@netbsd.org X-Mailer: log_accum Message-Id: <20200618133849.378FAFB28@cvs.NetBSD.org> Sender: pkgsrc-changes-owner@NetBSD.org List-Id: pkgsrc-changes.NetBSD.org Precedence: bulk List-Unsubscribe: This is a multi-part message in MIME format. --_----------=_159248752957980 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Module Name: pkgsrc Committed By: nat Date: Thu Jun 18 13:38:49 UTC 2020 Modified Files: pkgsrc/devel/diffbreaker/files/diffbreaker: diffbreaker.c Log Message: Use secondary buffer as an intermediatory to fix compilation with SSP_FORTIFY. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 \ pkgsrc/devel/diffbreaker/files/diffbreaker/diffbreaker.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. --_----------=_159248752957980 Content-Disposition: inline Content-Length: 1941 Content-Transfer-Encoding: binary Content-Type: text/x-diff; charset=us-ascii Modified files: Index: pkgsrc/devel/diffbreaker/files/diffbreaker/diffbreaker.c diff -u pkgsrc/devel/diffbreaker/files/diffbreaker/diffbreaker.c:1.6 pkgsrc/devel/diffbreaker/files/diffbreaker/diffbreaker.c:1.7 --- pkgsrc/devel/diffbreaker/files/diffbreaker/diffbreaker.c:1.6 Thu Jun 18 00:00:25 2020 +++ pkgsrc/devel/diffbreaker/files/diffbreaker/diffbreaker.c Thu Jun 18 13:38:49 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: diffbreaker.c,v 1.6 2020/06/18 00:00:25 nat Exp $ */ +/* $NetBSD: diffbreaker.c,v 1.7 2020/06/18 13:38:49 nat Exp $ */ /*- * Copyright (c) 2018, 2019 Nathanial Sloss @@ -101,9 +101,8 @@ mark_dirty(void) continue; } if (*ORIGBUF(i) == '+') { - if (j != i) - strncpy(ORIGBUF(j), ORIGBUF(i), len); - *ORIGBUF(j) = ' '; + strncpy(NEWBUF(j), ORIGBUF(i), len); + *NEWBUF(j) = ' '; action[j] = 0; } break; @@ -114,8 +113,7 @@ mark_dirty(void) pending = false; writesect = false; action[j] = action[i]; - if (j != i) - strncpy(ORIGBUF(j), ORIGBUF(i), len); + strncpy(NEWBUF(j), ORIGBUF(i), len); break; case 6: /* --- */ if (pending == false && writesect == false) @@ -126,13 +124,11 @@ mark_dirty(void) pending = true; writetome = false; writesect = true; - if (j != i) - strncpy(ORIGBUF(j), ORIGBUF(i), len); + strncpy(NEWBUF(j), ORIGBUF(i), len); action[j] = action[i]; break; case 7: /* +++ */ - if (j != i) - strncpy(ORIGBUF(j), ORIGBUF(i), len); + strncpy(NEWBUF(j), ORIGBUF(i), len); action[j] = action[i]; break; case 1: /* unselected change */ @@ -141,11 +137,11 @@ mark_dirty(void) writetome = true; /* fallthrough */ default: - if (j != i) - strncpy(ORIGBUF(j), ORIGBUF(i), len); + strncpy(NEWBUF(j), ORIGBUF(i), len); action[j] = action[i]; break; } + strncpy(ORIGBUF(j), NEWBUF(j), len); j++; } totalLines = display ? j-- : 0; --_----------=_159248752957980--