Private
Public Access
2
0

uart: use const char* instead of plain char*

Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
This commit is contained in:
Thomas Ingleby
2015-01-20 16:22:04 +00:00
parent 9cfbc87924
commit 25bd897ec5
6 changed files with 8 additions and 34 deletions

View File

@@ -180,12 +180,7 @@ mraa_raspberry_pi_b()
b->def_uart_dev = 0;
b->uart_dev[0].rx = 10;
b->uart_dev[0].tx = 8;
int uart_path_length = strlen(UART_DEV_PATH) + 1;
b->uart_dev[0].device_path = (char*) malloc(sizeof(char) * uart_path_length);
if (b->uart_dev[0].device_path == NULL) {
goto error;
}
strncpy(b->uart_dev[0].device_path, UART_DEV_PATH, uart_path_length);
b->uart_dev[0].device_path = UART_DEV_PATH;
return b;