mirror of
https://github.com/introlab/rtabmap.git
synced 2026-10-05 01:27:46 +08:00
Fixed extra endline in file logging (windows)
This commit is contained in:
@@ -139,10 +139,13 @@ protected:
|
|||||||
fileToClear.close();
|
fileToClear.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Open in binary mode: the log formatter already emits "\r\n" line endings explicitly.
|
||||||
|
// On Windows, text mode ("a") would translate the "\n" of that "\r\n" into "\r\n" again,
|
||||||
|
// producing "\r\r\n" on disk - i.e. an extra blank line between entries.
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
fopen_s(&fout_, fileName_.c_str(), "a");
|
fopen_s(&fout_, fileName_.c_str(), "ab");
|
||||||
#else
|
#else
|
||||||
fout_ = fopen(fileName_.c_str(), "a");
|
fout_ = fopen(fileName_.c_str(), "ab");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(!fout_) {
|
if(!fout_) {
|
||||||
|
|||||||
Reference in New Issue
Block a user