summaryrefslogtreecommitdiff
path: root/protocols/MSN/src/msn_misc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/MSN/src/msn_misc.cpp')
-rw-r--r--protocols/MSN/src/msn_misc.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/protocols/MSN/src/msn_misc.cpp b/protocols/MSN/src/msn_misc.cpp
index 7efabf73f9..a1cb7bfa0f 100644
--- a/protocols/MSN/src/msn_misc.cpp
+++ b/protocols/MSN/src/msn_misc.cpp
@@ -740,6 +740,7 @@ int ThreadData::sendPacket(const char* cmd, const char* fmt, ...)
int ThreadData::sendPacketPayload(const char* cmd, const char *param, const char* fmt, ...)
{
int thisTrid = 0;
+ bool bTopHdr;
if (this == NULL) return 0;
@@ -752,12 +753,13 @@ int ThreadData::sendPacketPayload(const char* cmd, const char *param, const char
thisTrid = InterlockedIncrement(&mTrid);
int regSz = proto->msnRegistration ? (int)mir_strlen(proto->msnRegistration)+16 : 0;
int paramStart = mir_snprintf(str, strsize, "%s %d %s ", cmd, thisTrid, param), strSz;
+ if (bTopHdr=*fmt=='\b') fmt++;
while ((strSz = mir_vsnprintf(str + paramStart, strsize - paramStart - regSz - 10, fmt, vararg)) == -1)
str = (char*)mir_realloc(str, strsize += 512);
- if (strSz) strSz+=2;
+ if (strSz && !bTopHdr) strSz+=2;
paramStart+=mir_snprintf(str+paramStart, strsize - paramStart , "%d\r\n", strSz+regSz);
if (proto->msnRegistration) paramStart+=mir_snprintf(str+paramStart, strsize - paramStart, "Registration: %s\r\n", proto->msnRegistration);
- if (strSz) paramStart+=mir_snprintf(str+paramStart, strsize - paramStart, "\r\n");
+ if (strSz && !bTopHdr) paramStart+=mir_snprintf(str+paramStart, strsize - paramStart, "\r\n");
mir_vsnprintf(str + paramStart, strsize - paramStart, fmt, vararg);
str[strsize - 3] = 0;
va_end(vararg);