diff options
author | Yaniv Kaul <ykaul@redhat.com> | 2018-08-21 20:42:53 +0300 |
---|---|---|
committer | Amar Tumballi <amarts@redhat.com> | 2018-08-31 06:15:46 +0000 |
commit | 7772315bd7d82d5f06f008dfe767f1e597a41b23 (patch) | |
tree | aa766b174482be034228698a994c8bbf9ac32b84 /tests/features/lock-migration/lkmigration-set-option.t | |
parent | dc6e6b71f87f6f89bb0b69816e92779595d716bd (diff) |
multiple xlators (storage/posix): strncpy()->sprintf(), reduce strlen()'s
xlators/storage/posix/src/posix-gfid-path.c
xlators/storage/posix/src/posix-handle.c
xlators/storage/posix/src/posix-helpers.c
xlators/storage/posix/src/posix-inode-fd-ops.c
xlators/storage/posix/src/posix.h
strncpy may not be very efficient for short strings copied into
a large buffer: If the length of src is less than n,
strncpy() writes additional null bytes to dest to ensure
that a total of n bytes are written.
Instead, use snprintf().
Also:
- save the result of strlen() and re-use it when possible.
- move from strlen to SLEN (sizeof() ) for const strings.
Compile-tested only!
Change-Id: I056939f111a4ec6bc8ebd539ebcaf9eb67da6c95
updates: bz#1193929
Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
Diffstat (limited to 'tests/features/lock-migration/lkmigration-set-option.t')
0 files changed, 0 insertions, 0 deletions