]> 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>
Mon, 20 May 2013 21:50:37 +0000 (18:50 -0300)
commit102cbbe26d75b5d0c60b590972e226528dbd4830
tree87fc0e8b38205bbe55618c8d63bef497e1673abd
parent51f0d188c5e493fa73342c9750f434ec5d150b71
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