summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Gampe <agampe@google.com>2014-12-09 05:05:13 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-12-09 05:05:13 +0000
commit6ce1b13b76004d63f31379d560e6e327c5e12382 (patch)
tree0d804d6d9db28df5b767ba17fe0b6157b5d3eab4
parent5b2d9248e0e5787cf5f1b08925da0b545093c58c (diff)
parentb487a59fdd012cc0cb6205b5fe88f7fb7c80ced9 (diff)
downloadmako-6ce1b13b76004d63f31379d560e6e327c5e12382.tar.gz
Merge "Conn_init: Fix unused variable"android-wear-5.0.0_r1lollipop-wear-release
-rw-r--r--conn_init/conn_init.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/conn_init/conn_init.c b/conn_init/conn_init.c
index 2cb5591..0aa5336 100644
--- a/conn_init/conn_init.c
+++ b/conn_init/conn_init.c
@@ -24,7 +24,7 @@ static int wifi_check_qcom_cfg_files()
{
char macAddress[13];
char hex[7];
- memset(macAddress, 0, 13);
+ memset(macAddress, 0, sizeof(macAddress));
memset(hex, 0, 7);
// Read MAC String
@@ -40,6 +40,10 @@ static int wifi_check_qcom_cfg_files()
{
n = fread(macAddress, 12, 1, fp);
fclose(fp);
+ if (n == 0) {
+ // Buffer may be partially written. Reset.
+ memset(macAddress, 0, sizeof(macAddress));
+ }
// Write MAC String
wfc_util_atoh( macAddress, 12, (unsigned char *)hex, 6);