Skip to content

Commit f3c8c25

Browse files
author
yutingzeng
committed
修正userbuf长度
1 parent e05f071 commit f3c8c25

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/tls_sig_api_v2.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -270,14 +270,13 @@ TLS_API std::string gen_userbuf(const std::string &account, uint32_t dwSdkappid,
270270
{
271271
int length = 1 + 2 + account.length() + 20;
272272
int offset = 0;
273+
if (roomStr.length() > 0)
274+
length += 2 + roomStr.length();
273275
char userBuf[length];
274276
memset(userBuf, 0, sizeof(userBuf));
275277

276278
if (roomStr.length() > 0)
277-
{
278279
userBuf[offset++] = 1;
279-
length += 2 + roomStr.length();
280-
}
281280
else
282281
userBuf[offset++] = 0;
283282

0 commit comments

Comments
 (0)