summaryrefslogtreecommitdiff
path: root/ChatUtilities.c
diff options
context:
space:
mode:
authorg8bpq <john.wiseman@cantab.net>2022-11-23 10:56:20 +0000
committerg8bpq <john.wiseman@cantab.net>2022-11-23 10:56:20 +0000
commitbe0f2b85761c40cbdc7339bbe722fad2d5e1eca4 (patch)
tree540662950bf06baabe89479a73adede3b484c392 /ChatUtilities.c
parent6c6848bdcbedcee989fefdd8d39105e7022aeae3 (diff)
6.0.23.2923.30
Diffstat (limited to 'ChatUtilities.c')
-rw-r--r--ChatUtilities.c14
1 files changed, 9 insertions, 5 deletions
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;
}