aboutsummaryrefslogtreecommitdiffstats
path: root/fs/befs
diff options
context:
space:
mode:
authorFabian Frederick <fabf@skynet.be>2014-06-06 17:36:15 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-06-06 19:08:09 -0400
commit6cb103b6f45ac0cf3b948457342e5cdcdaf49adc (patch)
tree33131d0a6d00623172fd7ce35cd2b565f2280acb /fs/befs
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')
-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,
405 * Heres how it works: Key_no is the index of the key/value pair to 405 * Heres how it works: Key_no is the index of the key/value pair to
406 * return in keybuf/value. 406 * return in keybuf/value.
407 * Bufsize is the size of keybuf (BEFS_NAME_LEN+1 is a good size). Keysize is 407 * Bufsize is the size of keybuf (BEFS_NAME_LEN+1 is a good size). Keysize is
408 * the number of charecters in the key (just a convenience). 408 * the number of characters in the key (just a convenience).
409 * 409 *
410 * Algorithm: 410 * Algorithm:
411 * Get the first leafnode of the tree. See if the requested key is in that 411 * 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,
502 "for key of size %d", __func__, bufsize, keylen); 502 "for key of size %d", __func__, bufsize, keylen);
503 brelse(this_node->bh); 503 brelse(this_node->bh);
504 goto error_alloc; 504 goto error_alloc;
505 }; 505 }
506 506
507 strncpy(keybuf, keystart, keylen); 507 strlcpy(keybuf, keystart, keylen + 1);
508 *value = fs64_to_cpu(sb, valarray[cur_key]); 508 *value = fs64_to_cpu(sb, valarray[cur_key]);
509 *keysize = keylen; 509 *keysize = keylen;
510 keybuf[keylen] = '\0';
511 510
512 befs_debug(sb, "Read [%llu,%d]: Key \"%.*s\", Value %llu", node_off, 511 befs_debug(sb, "Read [%llu,%d]: Key \"%.*s\", Value %llu", node_off,
513 cur_key, keylen, keybuf, *value); 512 cur_key, keylen, keybuf, *value);