summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2016-04-24 04:08:36 +0000
committerpfg <pfg@FreeBSD.org>2016-04-24 04:08:36 +0000
commit81085e95f4c900b60a4659258cd7d4e20cf13688 (patch)
treefdc511f926a71db0f80b8d5b22e7479a993a65a2 /usr.bin
parent45c64e5056abe3ab6dbd19ba97a0e9fad87b4dfc (diff)
downloadFreeBSD-src-81085e95f4c900b60a4659258cd7d4e20cf13688.zip
FreeBSD-src-81085e95f4c900b60a4659258cd7d4e20cf13688.tar.gz
patch(1): avoid signed integer overflow when debugging.
Integer i is used to index p_end of type LINENUM (actually long). Match the types. MFC after: 5 days
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/patch/pch.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/patch/pch.c b/usr.bin/patch/pch.c
index 0db459e..e12e833 100644
--- a/usr.bin/patch/pch.c
+++ b/usr.bin/patch/pch.c
@@ -1142,7 +1142,7 @@ hunk_done:
say("Not enough memory to swap next hunk!\n");
#ifdef DEBUGGING
if (debug & 2) {
- int i;
+ LINENUM i;
char special;
for (i = 0; i <= p_end; i++) {
@@ -1150,7 +1150,7 @@ hunk_done:
special = '^';
else
special = ' ';
- fprintf(stderr, "%3d %c %c %s", i, p_char[i],
+ fprintf(stderr, "%3ld %c %c %s", i, p_char[i],
special, p_line[i]);
fflush(stderr);
}
OpenPOWER on IntegriCloud