lib/path: use xstrncpy()
Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
parent
94d9fd9f6a
commit
e2569bcf26
|
@ -25,6 +25,7 @@
|
|||
#include "all-io.h"
|
||||
#include "path.h"
|
||||
#include "debug.h"
|
||||
#include "strutils.h"
|
||||
|
||||
/*
|
||||
* Debug stuff (based on include/debug.h)
|
||||
|
@ -279,8 +280,7 @@ char *ul_path_get_abspath(struct path_cxt *pc, char *buf, size_t bufsz, const ch
|
|||
|
||||
if (!tmp)
|
||||
return NULL;
|
||||
strncpy(buf, tmp, bufsz);
|
||||
buf[bufsz - 1] = '\0';
|
||||
xstrncpy(buf, tmp, bufsz);
|
||||
}
|
||||
|
||||
return buf;
|
||||
|
|
Loading…
Reference in New Issue