coverity scan CID 22433: buffer not null terminated, prefer strlcpy over strncpy

This commit is contained in:
Enno Rehling 2015-10-29 09:04:23 +01:00
parent 04bf07a526
commit 78899ca801
1 changed files with 2 additions and 1 deletions

View File

@ -11,6 +11,7 @@ without prior permission by the authors of Eressea.
*/
#include <platform.h>
#include "log.h"
#include "bsdstring.h"
#include "unicode.h"
#include <assert.h>
@ -144,7 +145,7 @@ static int check_dupe(const char *format, const char *type)
}
dupes = 0;
}
strncpy(last_message, format, sizeof(last_message));
strlcpy(last_message, format, sizeof(last_message));
last_type = type;
return 0;
}