Blame SOURCES/cscope-1-modified-from-patch-81-Fix-reading-include-files-in-.patch

37d6e3
From 39fb385d69dc06343e8f8a7e28d516d5aef97ec8 Mon Sep 17 00:00:00 2001
37d6e3
From: Hans-Bernhard Broeker <HBBroeker@T-Online.de>
37d6e3
Date: Sat, 28 Jul 2018 17:50:03 +0200
37d6e3
Subject: [PATCH 1/9] [modified from patch #81] Fix reading include files in -c
37d6e3
 mode
37d6e3
37d6e3
Signed-off-by: Vladis Dronov <vdronov@redhat.com>
37d6e3
---
37d6e3
 src/build.c | 6 +++---
37d6e3
 1 file changed, 3 insertions(+), 3 deletions(-)
37d6e3
37d6e3
diff --git a/src/build.c b/src/build.c
37d6e3
index a32b5cb..557e660 100644
37d6e3
--- a/src/build.c
37d6e3
+++ b/src/build.c
37d6e3
@@ -124,7 +124,7 @@ samelist(FILE *oldrefs, char **names, int count)
37d6e3
     }
37d6e3
     /* see if the name list is the same */
37d6e3
     for (i = 0; i < count; ++i) {
37d6e3
-	if ((1 != fscanf(oldrefs," %[^\n]",oldname)) ||
37d6e3
+	if ((1 != fscanf(oldrefs," %" PATHLEN_STR "[^\n]",oldname)) ||
37d6e3
 	    strnotequal(oldname, names[i])) {
37d6e3
 	    return(NO);
37d6e3
 	}
37d6e3
@@ -305,7 +305,7 @@ cscope: -q option mismatch between command line and old symbol database\n");
37d6e3
 	/* see if the list of source files is the same and
37d6e3
 	   none have been changed up to the included files */
37d6e3
 	for (i = 0; i < nsrcfiles; ++i) {
37d6e3
-	    if ((1 != fscanf(oldrefs," %[^\n]",oldname))
37d6e3
+	    if ((1 != fscanf(oldrefs, " %" PATHLEN_STR "[^\n]", oldname))
37d6e3
 		|| strnotequal(oldname, srcfiles[i])
37d6e3
 		|| (lstat(srcfiles[i], &statstruct) != 0)
37d6e3
 		|| (statstruct.st_mtime > reftime)
37d6e3
@@ -315,7 +315,7 @@ cscope: -q option mismatch between command line and old symbol database\n");
37d6e3
 	}
37d6e3
 	/* the old cross-reference is up-to-date */
37d6e3
 	/* so get the list of included files */
37d6e3
-	while (i++ < oldnum && fgets(oldname, sizeof(oldname), oldrefs)) {
37d6e3
+	while (i++ < oldnum && fscanf(oldrefs, "%" PATHLEN_STR "s", oldname)) {
37d6e3
 	    addsrcfile(oldname);
37d6e3
 	}
37d6e3
 	fclose(oldrefs);
37d6e3
-- 
37d6e3
2.26.2
37d6e3