diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2014-11-15 23:24:58 (GMT) |
---|---|---|
committer | Dimitri van Heesch <dimitri@stack.nl> | 2014-11-15 23:26:58 (GMT) |
commit | 9b7e4ffb6c5f7534e4ba11d5798b4eb74d4a2a70 (patch) | |
tree | cde604068dbe270c51a6790189c30594e0d78b70 /src/message.cpp | |
parent | e986e0039de21791bd1fbb1f59b13f58c4a46324 (diff) | |
download | Doxygen-9b7e4ffb6c5f7534e4ba11d5798b4eb74d4a2a70.zip Doxygen-9b7e4ffb6c5f7534e4ba11d5798b4eb74d4a2a70.tar.gz Doxygen-9b7e4ffb6c5f7534e4ba11d5798b4eb74d4a2a70.tar.bz2 |
Fixed several Coverity warnings
Diffstat (limited to 'src/message.cpp')
-rw-r--r-- | src/message.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/message.cpp b/src/message.cpp index 11b4502..4156720 100644 --- a/src/message.cpp +++ b/src/message.cpp @@ -152,15 +152,16 @@ static void format_warn(const char *file,int line,const char *text) static void do_warn(const char *tag, const char *file, int line, const char *prefix, const char *fmt, va_list args) { if (!Config_getBool(tag)) return; // warning type disabled - char text[40960]; + const int bufSize = 40960; + char text[bufSize]; int l=0; if (prefix) { - strcpy(text,prefix); + qstrncpy(text,prefix,bufSize); l=strlen(prefix); } - vsnprintf(text+l, 40960-l, fmt, args); - text[40960-1]='\0'; + vsnprintf(text+l, bufSize-l, fmt, args); + text[bufSize-1]='\0'; format_warn(file,line,text); } |