Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Apr 2016 02:56:03 +0000 (UTC)
From:      "Pedro F. Giffuni" <pfg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r298763 - stable/10/usr.bin/patch
Message-ID:  <201604290256.u3T2u3Yc087811@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pfg
Date: Fri Apr 29 02:56:03 2016
New Revision: 298763
URL: https://svnweb.freebsd.org/changeset/base/298763

Log:
  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.

Modified:
  stable/10/usr.bin/patch/pch.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/usr.bin/patch/pch.c
==============================================================================
--- stable/10/usr.bin/patch/pch.c	Fri Apr 29 01:53:45 2016	(r298762)
+++ stable/10/usr.bin/patch/pch.c	Fri Apr 29 02:56:03 2016	(r298763)
@@ -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);
 		}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201604290256.u3T2u3Yc087811>