aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Kralevich <nnk@google.com>2013-10-09 17:24:40 -0700
committerNick Kralevich <nnk@google.com>2013-10-09 23:19:27 -0700
commit9fc27663273414cee93f5219d48a28fe84b0bb7e (patch)
tree14750d30f4b5a86f8e0c6c3efc5cd500293b3188
parentb2b95168dce5a0330ffb5ae962db49b1697e92f7 (diff)
downloadwpan-kitkat-dev.tar.gz
You're gonna have a bad day if you attempt to read 3 bytes into 1 byte. (cherry picked from commit b4f59474493a0793375e723edbd0d29e55a8c581) Change-Id: I6beea5631f30f4aa04ebbed10207f399187bf218
-rw-r--r--tools/kfmapp/kfmapp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/kfmapp/kfmapp.c b/tools/kfmapp/kfmapp.c
index d35a64f..1f2b923 100644
--- a/tools/kfmapp/kfmapp.c
+++ b/tools/kfmapp/kfmapp.c
@@ -731,7 +731,7 @@ exit:
int fmapp_get_rx_rssi_threshold(void)
{
- unsigned char fm_rssi_threshhold;
+ unsigned char fm_rssi_threshhold[4];
int fd, res;
fd = open(FMRX_RSSI_LVL_SYSFS_ENTRY, O_RDONLY);
@@ -746,6 +746,7 @@ int fmapp_get_rx_rssi_threshold(void)
FMRX_RSSI_LVL_SYSFS_ENTRY,strerror(res));
goto exit;
}
+ fm_rssi_threshhold[3] = '\0';
printf("Current FM RSSI threshold level is %d \n",
atoi((char *) &fm_rssi_threshhold));