channels: fix possible overflow in logging

Fixes clang compiler warning:

"warning: the value of the size argument in 'strncat' is too large,
might lead to a buffer overflow [-Wstrncat-size]"

strncat requires an extra byte for '\0' so dest needs to have a size of
n+1
This commit is contained in:
Bernhard Miklautz 2014-08-29 16:37:14 +02:00
parent d37af95e70
commit 3e355c9f79

View File

@ -28,8 +28,8 @@
wLogMessage msg; \
wLog *log; \
\
strncat(tag, "com.freerdp.channels.", sizeof(tag)); \
strncat(tag, dbg_str, sizeof(tag) - sizeof("com.freerdp.channels.")); \
strncat(tag, "com.freerdp.channels.", sizeof(tag) - 1); \
strncat(tag, dbg_str, sizeof(tag) - 1 - sizeof("com.freerdp.channels.")); \
log = WLog_Get(tag); \
\
msg.Type = WLOG_MESSAGE_TEXT; \