From be0f2b85761c40cbdc7339bbe722fad2d5e1eca4 Mon Sep 17 00:00:00 2001 From: g8bpq Date: Wed, 23 Nov 2022 10:56:20 +0000 Subject: 6.0.23.29 --- ChatUtilities.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'ChatUtilities.c') diff --git a/ChatUtilities.c b/ChatUtilities.c index 56d43a9..50b6b8b 100644 --- a/ChatUtilities.c +++ b/ChatUtilities.c @@ -320,7 +320,7 @@ char * ReadInfoFile(char * File) FILE * hFile; char * MsgBytes; struct stat STAT; - char * ptr1 = 0; + char * ptr1 = 0, * ptr2; sprintf_s(MsgFile, sizeof(MsgFile), "%s/%s", GetBPQDirectory(), File); @@ -342,11 +342,16 @@ char * ReadInfoFile(char * File) MsgBytes[FileSize]=0; -#ifndef WIN32 + // Replace LF or CRLF with CR - // Replace LF with CR + // First remove cr from crlf - // Remove lf chars + while(ptr2 = strstr(ptr1, "\r\n")) + { + memmove(ptr2, ptr2 + 1, strlen(ptr2)); + } + + // Now replace lf with cr ptr1 = MsgBytes; @@ -357,7 +362,6 @@ char * ReadInfoFile(char * File) ptr1++; } -#endif return MsgBytes; } -- cgit v1.2.3