summaryrefslogtreecommitdiff
path: root/plugins/tist.c
diff options
context:
space:
mode:
authorSamuel Ortiz <sameo@linux.intel.com>2011-03-17 17:37:20 +0100
committerSamuel Ortiz <sameo@linux.intel.com>2011-03-17 17:37:20 +0100
commit849f635ba989be5aa40a9c12ab72d4a72558e492 (patch)
tree0fe2814d34be38e7fc7d8b2f5b1ef6f3b49df23d /plugins/tist.c
parent17912e9adca8d1fd06abeb7ffd9d722c6bfa376d (diff)
downloadconnman-849f635ba989be5aa40a9c12ab72d4a72558e492.tar.gz
connman-849f635ba989be5aa40a9c12ab72d4a72558e492.tar.bz2
connman-849f635ba989be5aa40a9c12ab72d4a72558e492.zip
tist: Fix initializing of variable
sizeof(char []) is a pointer size. Reported by: DJ Cozatt <ygdrasil@comcast.net>
Diffstat (limited to 'plugins/tist.c')
-rw-r--r--plugins/tist.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/plugins/tist.c b/plugins/tist.c
index 28498b61..b8c89cfd 100644
--- a/plugins/tist.c
+++ b/plugins/tist.c
@@ -115,14 +115,14 @@ static int read_baud_rate(unsigned long *baud)
return err;
}
-static int read_uart_name(char uart_name[])
+static int read_uart_name(char uart_name[], size_t uart_name_len)
{
int err;
FILE *f;
DBG("");
- memset(uart_name, 0, sizeof(uart_name));
+ memset(uart_name, 0, uart_name_len);
f = fopen(TIST_SYSFS_UART, "r");
if (f == NULL)
@@ -510,7 +510,7 @@ static int tist_init(void)
int fd, err;
gsize len;
- err = read_uart_name(uart_dev_name);
+ err = read_uart_name(uart_dev_name, sizeof(uart_dev_name));
if (err < 0) {
connman_error("Could not read the UART name");
return err;