diff options
author | Jim Meyering <meyering@redhat.com> | 2012-06-04 15:04:01 +0200 |
---|---|---|
committer | Anand Avati <avati@redhat.com> | 2012-07-02 15:29:58 -0700 |
commit | d1610978436dda903e50552eed0cb8116dae88b9 (patch) | |
tree | 2e441179fcedb614a7774c83c305664cc5288d6d /xlators/storage/posix/src/posix-handle.c | |
parent | b583363dcc0cf87b4ca27b99bca532da764e3a07 (diff) |
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 <meyering@redhat.com>
Reviewed-on: http://review.gluster.com/3587
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'xlators/storage/posix/src/posix-handle.c')
-rw-r--r-- | xlators/storage/posix/src/posix-handle.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; } |