aboutsummaryrefslogtreecommitdiff
path: root/src/writer.cc
diff options
context:
space:
mode:
authorfusion32 <marcopuzziello@gmail.com>2025-07-16 17:22:39 -0300
committerfusion32 <marcopuzziello@gmail.com>2025-07-16 17:22:39 -0300
commit6d498fe17dab48cfd8fc8a4da62a573b799e10ba (patch)
tree1c8d55bd907b35abf014385dbedb90b2ae98f96a /src/writer.cc
parente65dc561acab7a9e49f59777f16cb040c574c64d (diff)
downloadgame-6d498fe17dab48cfd8fc8a4da62a573b799e10ba.tar.gz
game-6d498fe17dab48cfd8fc8a4da62a573b799e10ba.zip
fix most init and parsing bugs + critical bug with dynamic strings
With an appropriate query manager, the server now starts up and seems to work but won't properly handle connections until we fix the problem with threads and signals described in `TODO.md`.
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){