]> git.karo-electronics.de Git - karo-tx-linux.git/commit
Bluetooth: hidp: using strlcpy instead of strncpy, also beautify code.
authorChen Gang <gang.chen@asianux.com>
Mon, 13 May 2013 02:07:11 +0000 (10:07 +0800)
committerGustavo Padovan <gustavo.padovan@collabora.co.uk>
Wed, 29 May 2013 21:43:41 +0000 (18:43 -0300)
commita81fd5297ca70fa16ea35b691dfdf95bdfbdff77
treefcb6bf590d3a72ad98f9f65867322ad0a4a95763
parent07a783b2a933b33d032ec73430f9ef434c3056f2
Bluetooth: hidp: using strlcpy instead of strncpy, also beautify code.

For NULL terminated string, need always let it ended by zero.

Since have already called memcpy() to initialize 'ci', so need not
redundant initialization.

Better use ''if(session->hid) {} else if(session->input) {}"" instead
of ''if(session->hid) {}; if(session->input) {};''

Signed-off-by: Chen Gang <gang.chen@asianux.com>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Acked-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
net/bluetooth/hidp/core.c