aboutsummaryrefslogtreecommitdiff
path: root/src/writer.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/writer.cc')
-rw-r--r--src/writer.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/writer.cc b/src/writer.cc
index dbe0cb0..093711e 100644
--- a/src/writer.cc
+++ b/src/writer.cc
@@ -146,11 +146,13 @@ void Log(const char *ProtocolName, const char *Text, ...){
if(Line[0] != 0){
int LineEnd = (int)strlen(Line);
- if(LineEnd < (int)(sizeof(Line) - 1)){
- Line[LineEnd] = '\n';
- Line[LineEnd + 1] = 0;
- }else{
- Line[LineEnd - 1] = '\n';
+ if(Line[LineEnd - 1] != '\n'){
+ if(LineEnd < (int)(sizeof(Line) - 1)){
+ Line[LineEnd] = '\n';
+ Line[LineEnd + 1] = 0;
+ }else{
+ Line[LineEnd - 1] = '\n';
+ }
}
if(ProtocolThread != INVALID_THREAD_HANDLE){