summaryrefslogtreecommitdiff
path: root/fs/befs/btree.c
diff options
context:
space:
mode:
authorFabian Frederick <fabf@skynet.be>2014-06-06 14:36:15 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2014-06-06 16:08:09 -0700
commit6cb103b6f45ac0cf3b948457342e5cdcdaf49adc (patch)
tree33131d0a6d00623172fd7ce35cd2b565f2280acb /fs/befs/btree.c
parent39d7a29f867bd5a4a551fad6bb3812ceddb0bce1 (diff)
fs/befs/btree.c: replace strncpy by strlcpy + coding style fixing
- strncpy + end of string assignement replaced by strlcpy - Fix endif }; - Fix typo Signed-off-by: Fabian Frederick <fabf@skynet.be> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/befs/btree.c')
-rw-r--r--fs/befs/btree.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/fs/befs/btree.c b/fs/befs/btree.c
index a2cd305a993a..9d7d00e04858 100644
--- a/fs/befs/btree.c
+++ b/fs/befs/btree.c
@@ -405,7 +405,7 @@ befs_find_key(struct super_block *sb, befs_btree_node * node,
* Heres how it works: Key_no is the index of the key/value pair to
* return in keybuf/value.
* Bufsize is the size of keybuf (BEFS_NAME_LEN+1 is a good size). Keysize is
- * the number of charecters in the key (just a convenience).
+ * the number of characters in the key (just a convenience).
*
* Algorithm:
* Get the first leafnode of the tree. See if the requested key is in that
@@ -502,12 +502,11 @@ befs_btree_read(struct super_block *sb, befs_data_stream * ds,
"for key of size %d", __func__, bufsize, keylen);
brelse(this_node->bh);
goto error_alloc;
- };
+ }
- strncpy(keybuf, keystart, keylen);
+ strlcpy(keybuf, keystart, keylen + 1);
*value = fs64_to_cpu(sb, valarray[cur_key]);
*keysize = keylen;
- keybuf[keylen] = '\0';
befs_debug(sb, "Read [%llu,%d]: Key \"%.*s\", Value %llu", node_off,
cur_key, keylen, keybuf, *value);