From d1610978436dda903e50552eed0cb8116dae88b9 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Mon, 4 Jun 2012 15:04:01 +0200 Subject: posix: avoid unnecessary strncpy When strlen(SRC) < LEN, using strncpy is misleading. Use strcpy instead. Change-Id: I76832353dc415de99f0583d085d5c2444d5fe8b0 BUG: 789278 Signed-off-by: Jim Meyering Reviewed-on: http://review.gluster.com/3587 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- xlators/storage/posix/src/posix-handle.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xlators/storage') diff --git a/xlators/storage/posix/src/posix-handle.c b/xlators/storage/posix/src/posix-handle.c index 2c9277e7f..a06e6430f 100644 --- a/xlators/storage/posix/src/posix-handle.c +++ b/xlators/storage/posix/src/posix-handle.c @@ -108,7 +108,7 @@ posix_handle_pump (xlator_t *this, char *buf, int len, int maxlen, if ((ret == 8) && memcmp (linkname, "../../..", 8) == 0) { if (strcmp (base_str, buf) == 0) { - strncpy (buf + pfx_len, "..", 3); + strcpy (buf + pfx_len, ".."); } goto out; } -- cgit