From 8ecd8de15cf55f9569b670e33171fc91c96b48d7 Mon Sep 17 00:00:00 2001 From: Alex Zhuravlev Date: Tue, 2 Apr 2019 15:14:35 +0300 Subject: [PATCH] LU-12147 utils: statone doesn't place \0 as strncpy() is not supposed to do, the caller has to take care of that. Change-Id: I858a7f0eb6c7cdcb70e8a8e445c96f1187c73c2f Signed-off-by: Alex Zhuravlev Reviewed-on: https://review.whamcloud.com/34572 Reviewed-by: Patrick Farrell Reviewed-by: James Simmons Reviewed-by: Mike Pershin Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Oleg Drokin --- lustre/tests/statone.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lustre/tests/statone.c b/lustre/tests/statone.c index 0f11d5d..42d9ec3 100644 --- a/lustre/tests/statone.c +++ b/lustre/tests/statone.c @@ -59,6 +59,7 @@ int main(int argc, char **argv) } else { strncpy(parent, base, t - base); offset = t - base - 1; + parent[t - base] = 0; } fd = open(parent, O_RDONLY); -- 1.8.3.1