lib/path: use xstrncpy()

Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
Karel Zak 2019-05-20 12:57:16 +02:00
parent 94d9fd9f6a
commit e2569bcf26
1 changed files with 2 additions and 2 deletions

View File

@ -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;