diff options
author | Francois Beaufort <beaufort.francois@gmail.com> | 2016-04-21 10:18:49 +0200 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2016-04-22 15:03:17 +0300 |
commit | f060c3a5dc22ab50692b07c1da65e598f6e92535 (patch) | |
tree | c243a31d4875cdb7c801bc8addb5a26608a7865d /profiles | |
parent | 6b3f0f3ab935e192db9cf73b68a27271d4febd74 (diff) | |
download | bluez-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.c | 2 |
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; |