Fixed static analysis errors from cppcheck. 51/124051/3
authorNishant Chaprana <n.chaprana@samsung.com>
Mon, 10 Apr 2017 05:01:58 +0000 (10:31 +0530)
committerNishant Chaprana <n.chaprana@samsung.com>
Wed, 26 Apr 2017 07:02:29 +0000 (12:32 +0530)
commit3c836f9161978e701fad78779c0339459ad27a8b
tree4ef9ef80e1149bd5b76ca912c3d39e73fb9f11bd
parent0bee7832354fe1404b717093980b0cdd4deace93
Fixed static analysis errors from cppcheck.

wifi-direct$ cppcheck --enable=all --force ./ | grep error
[src/wifi-direct-client-proxy.c:1160] -> [src/wifi-direct-client-proxy.c:1164]: (performance) Variable 'ret' is reassigned a value before the old one has been used.
[src/wifi-direct-client-proxy.c:2425]: (style) Variable 'result' is assigned a value that is never used.
[test/test-wifi-direct.c:892] -> [test/test-wifi-direct.c:878]: (warning) Possible null pointer dereference: ad - otherwise it is redundant to check it against null.
[test/test-wifi-direct.c:893] -> [test/test-wifi-direct.c:878]: (warning) Possible null pointer dereference: ad - otherwise it is redundant to check it against null.
[test/test-wifi-direct.c:2514]: (warning) Array index -1 is out of bounds. Otherwise there is useless condition at line 2515.
[test/test-wifi-direct.c:2464]: (portability) scanf without field width limits can crash with huge input data on some versions of libc.
[test/test-wifi-direct.c:891]: (error) Uninitialized variable: result
[src/wifi-direct-client-proxy.c:682]: (style) The function '__wfd_client_print_connected_peer_info' is never used.
[src/wifi-direct-client-proxy.c:665]: (style) The function '__wfd_client_print_entry_list' is never used.
[src/wifi-direct-client-proxy.c:698]: (style) The function '__wfd_client_print_persistent_group_info' is never used.
[test/test-wifi-direct.c:304]: (style) The function 'get_appdata' is never used.
[test/test-wifi-direct.c:341]: (style) The function 'usage' is never used.
[src/wifi-direct-dbus.c:151]: (style) The function 'wifi_direct_dbus_method_call_sync_debug' is never used.
[src/wifi-direct-client-proxy.c:1110]: (style) The function 'wifi_direct_unset_client_ip_address_assigned_cb' is never used.
(information) Cppcheck cannot find all the include files (use --check-config for details)

Change-Id: Ic9931366bb562a0f73d29ce24f67a65bfdd499eb
Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
src/wifi-direct-client-proxy.c
test/test-wifi-direct.c