summaryrefslogtreecommitdiff
path: root/profiles
diff options
context:
space:
mode:
authorFrancois Beaufort <beaufort.francois@gmail.com>2016-04-21 10:18:49 +0200
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2016-04-22 15:03:17 +0300
commitf060c3a5dc22ab50692b07c1da65e598f6e92535 (patch)
treec243a31d4875cdb7c801bc8addb5a26608a7865d /profiles
parent6b3f0f3ab935e192db9cf73b68a27271d4febd74 (diff)
downloadbluez-f060c3a5dc22ab50692b07c1da65e598f6e92535.tar.gz
audio/avrcp: Fix uninitialized variable
This fixes the following error: profiles/audio/avrcp.c:2847:6: error: variable 'num_of_items' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized] if (pdu->params[0] == AVRCP_STATUS_OUT_OF_BOUNDS) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ profiles/audio/avrcp.c:2857:40: note: uninitialized use occurs here media_player_total_items_complete(mp, num_of_items); ^~~~~~~~~~~~ profiles/audio/avrcp.c:2847:2: note: remove the 'if' if its condition is always false if (pdu->params[0] == AVRCP_STATUS_OUT_OF_BOUNDS) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ profiles/audio/avrcp.c:2839:23: note: initialize the variable 'num_of_items' to silence this warning uint32_t num_of_items; ^ = 0
Diffstat (limited to 'profiles')
-rw-r--r--profiles/audio/avrcp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/profiles/audio/avrcp.c b/profiles/audio/avrcp.c
index 37bc29137..70c184b1c 100644
--- a/profiles/audio/avrcp.c
+++ b/profiles/audio/avrcp.c
@@ -3112,7 +3112,7 @@ static gboolean avrcp_get_total_numberofitems_rsp(struct avctp *conn,
struct avrcp *session = user_data;
struct avrcp_player *player = session->controller->player;
struct media_player *mp = player->user_data;
- uint32_t num_of_items;
+ uint32_t num_of_items = 0;
if (pdu == NULL)
return -ETIMEDOUT;