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