From 849f635ba989be5aa40a9c12ab72d4a72558e492 Mon Sep 17 00:00:00 2001 From: Samuel Ortiz Date: Thu, 17 Mar 2011 17:37:20 +0100 Subject: [PATCH] tist: Fix initializing of variable sizeof(char []) is a pointer size. Reported by: DJ Cozatt --- plugins/tist.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/tist.c b/plugins/tist.c index 28498b6..b8c89cf 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; -- 2.7.4