Skip to content

Commit

Permalink
--exclude option accepts file with long line (4096 caracters)
Browse files Browse the repository at this point in the history
  • Loading branch information
lathuili-home committed Jun 14, 2018
1 parent e28d801 commit d1c77f2
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions vr_exclude.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@

#include "vr_main.h"

#define LINE_SIZEMAX VR_FNNAME_BUFSIZE

static Vr_Exclude* vr_addExclude (Vr_Exclude* list, const HChar * fnname, const HChar * objname) {
Vr_Exclude * cell = VG_(malloc)("vr.addExclude.1", sizeof(Vr_Exclude));
cell->fnname = VG_(strdup)("vr.addExclude.2", fnname);
Expand Down Expand Up @@ -99,7 +101,7 @@ Vr_Exclude * vr_loadExcludeList (Vr_Exclude * list, const HChar * fname) {
return list;
}

SizeT nLine = 256;
SizeT nLine = LINE_SIZEMAX;
HChar *line = VG_(malloc)("vr.loadExcludes.1", nLine*sizeof(HChar));
Int lineno = 0;

Expand All @@ -108,17 +110,17 @@ Vr_Exclude * vr_loadExcludeList (Vr_Exclude * list, const HChar * fname) {

// Skip non-blank characters
for (c = line;
c<line+256 && *c != 0 && *c != '\t' && *c != ' ';
c<line+LINE_SIZEMAX && *c != 0 && *c != '\t' && *c != ' ';
++c) {}
if (*c == 0 || c>line+255) {
if (*c == 0 || c>line+LINE_SIZEMAX-1) {
VG_(umsg)("ERROR (parse)\n");
return list;
}
*c = 0;

// Skip blank characters
for (++c;
c<line+256 && *c != 0 && (*c == '\t' || *c == ' ');
c<line+LINE_SIZEMAX && *c != 0 && (*c == '\t' || *c == ' ');
++c) {}

list = vr_addExclude (list,
Expand Down

0 comments on commit d1c77f2

Please sign in to comment.