diff options
author | pfg <pfg@FreeBSD.org> | 2016-04-29 02:56:03 +0000 |
---|---|---|
committer | pfg <pfg@FreeBSD.org> | 2016-04-29 02:56:03 +0000 |
commit | 9bfc50da6e3207cd7618dc30f5d0256a8177d934 (patch) | |
tree | 6b4db82cc4ad7e2224d5090a6e930e9d9372b4e8 /usr.bin | |
parent | 1d5d3749a4b560c02782ced59660844e31c631a9 (diff) | |
download | FreeBSD-src-9bfc50da6e3207cd7618dc30f5d0256a8177d934.zip FreeBSD-src-9bfc50da6e3207cd7618dc30f5d0256a8177d934.tar.gz |
MFC r298530:
patch(1): avoid signed integer overflow when debugging.
Integer i is used to index p_end of type LINENUM (actually long).
Match the types.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/patch/pch.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/patch/pch.c b/usr.bin/patch/pch.c index 357c364..8aee8b2 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); } |