Skip to content

Commit

Permalink
Merge pull request #25656 from Dr15Jones/strtokHcalLaserEventFilter2012
Browse files Browse the repository at this point in the history
Use strtok_r in HcalLaserEventFilter2012
  • Loading branch information
cmsbuild committed Jan 16, 2019
2 parents 958b32c + 6eb570d commit d5c14da
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions EventFilter/HcalRawToDigi/plugins/HcalLaserEventFilter2012.cc
Expand Up @@ -111,7 +111,8 @@ void HcalLaserEventFilter2012::readEventListFile(const string & eventFileName)
bytes_read = gzread (file, buffer, LENGTH - 1);
buffer[bytes_read] = '\0';
i=0;
pch = strtok (buffer,"\n");
char* saveptr;
pch = strtok_r (buffer,"\n",&saveptr);
if (buffer[0] == '\n' ) {
addEventString(b2);
++i;
Expand All @@ -129,7 +130,7 @@ void HcalLaserEventFilter2012::readEventListFile(const string & eventFileName)
} else if (i<LENGTH) {
addEventString(b2);
}
pch = strtok (nullptr, "\n");
pch = strtok_r (nullptr, "\n", &saveptr);
}
if (bytes_read < LENGTH - 1) {
if (gzeof (file)) break;
Expand Down

0 comments on commit d5c14da

Please sign in to comment.