diff options
author | Andreas Gampe <agampe@google.com> | 2014-12-09 15:03:53 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-12-09 15:03:53 +0000 |
commit | 9da847daefd84285957167bc8be15472271f18fa (patch) | |
tree | f9f529d6791f5eb2b8c1159979483828ce527d19 | |
parent | 2f9b0343452eef9b4508e1e82224ca91ba9dcf42 (diff) | |
parent | 6ce1b13b76004d63f31379d560e6e327c5e12382 (diff) | |
download | mako-9da847daefd84285957167bc8be15472271f18fa.tar.gz |
am 6ce1b13b: Merge "Conn_init: Fix unused variable"
* commit '6ce1b13b76004d63f31379d560e6e327c5e12382':
Conn_init: Fix unused variable
-rw-r--r-- | conn_init/conn_init.c | 6 |
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); |