diff options
author | bryner <bryner@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2006-11-20 20:58:10 +0000 |
---|---|---|
committer | bryner <bryner@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2006-11-20 20:58:10 +0000 |
commit | 042ca733d309f48d2987a81151cbf3c59b73e562 (patch) | |
tree | f06629324633779115ecc74fc471ed5be0c38ec1 | |
parent | Removing erroneous svn:executable setting. (diff) | |
download | breakpad-042ca733d309f48d2987a81151cbf3c59b73e562.tar.xz |
Use the reentrant versions of strtok() and gmtime() (#79) r=mmentovai
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@69 4c0a9323-5329-0410-9bdc-e9ce6186880e
-rw-r--r-- | src/processor/minidump.cc | 6 | ||||
-rw-r--r-- | src/processor/source_line_resolver.cc | 7 |
2 files changed, 7 insertions, 6 deletions
diff --git a/src/processor/minidump.cc b/src/processor/minidump.cc index 9232b3bd..d557d0bc 100644 --- a/src/processor/minidump.cc +++ b/src/processor/minidump.cc @@ -2304,10 +2304,10 @@ void Minidump::Print() { printf(" stream_count = %d\n", header_.stream_count); printf(" stream_directory_rva = 0x%x\n", header_.stream_directory_rva); printf(" checksum = 0x%x\n", header_.checksum); - struct tm* timestruct = - gmtime(reinterpret_cast<time_t*>(&header_.time_date_stamp)); + struct tm timestruct; + gmtime_r(reinterpret_cast<time_t*>(&header_.time_date_stamp), ×truct); char timestr[20]; - strftime(timestr, 20, "%Y-%m-%d %H:%M:%S", timestruct); + strftime(timestr, 20, "%Y-%m-%d %H:%M:%S", ×truct); printf(" time_date_stamp = 0x%x %s\n", header_.time_date_stamp, timestr); printf(" flags = 0x%llx\n", header_.flags); diff --git a/src/processor/source_line_resolver.cc b/src/processor/source_line_resolver.cc index 59b8828f..66e31288 100644 --- a/src/processor/source_line_resolver.cc +++ b/src/processor/source_line_resolver.cc @@ -365,16 +365,17 @@ bool SourceLineResolver::Module::Tokenize(char *line, int max_tokens, // Split tokens on the space character. Look for newlines too to // strip them out before exhausting max_tokens. - char *token = strtok(line, " \r\n"); + char *save_ptr; + char *token = strtok_r(line, " \r\n", &save_ptr); while (token && --remaining > 0) { tokens->push_back(token); if (remaining > 1) - token = strtok(NULL, " \r\n"); + token = strtok_r(NULL, " \r\n", &save_ptr); } // If there's anything left, just add it as a single token. if (!remaining > 0) { - if ((token = strtok(NULL, "\r\n"))) { + if ((token = strtok_r(NULL, "\r\n", &save_ptr))) { tokens->push_back(token); } } |