Avoid potential buffer overrun in bd2str caused by signed char

Use uint8_t to avoid sign extension as char's may be signed.
As a further safeguard, use snprintf()

Change-Id: Icdd4dba9b270bde41547677fa2f98bf215401a23

Conflicts:
	btif/src/btif_util.c
Accept takes a socklen_t, not an int.

Change-Id: I0e89aae4a560c3ed9821cbb4432f56e25f3d1c94
Fix warning "suggest braces around empty body in an 'if' statement"

The body of an if statement could become empty if the macro body
is NULL and cause the if to apply to the next line instead.

Signed-off-by: Mike J. Chen <mjchen@google.com>
(cherry picked from dbdc69f4aed8a4eb3af31982c4722b10ee774740)

Change-Id: Ie4a18920e1fc959910451a70edcff6d7fd16e501