Skip to content

Commit

Permalink
Use strtok_r in HcalLaserEventFilter2012
Browse files Browse the repository at this point in the history
Replace the thread-hostile strtok with strtok_r.
  • Loading branch information
Dr15Jones committed Jan 14, 2019
1 parent 842f8a0 commit 6eb570d
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 6eb570d

Please sign in to comment.