Private
Public Access
2
0

internal/platform_name: move to const char*

Instead of plain char* to avoid need to malloc and do all the needed
error checking needed that goes along with that.

Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
This commit is contained in:
Thomas Ingleby
2015-01-21 15:35:54 +00:00
parent 067487f9ec
commit 53a9a7dce4
7 changed files with 7 additions and 38 deletions

View File

@@ -125,13 +125,7 @@ mraa_intel_galileo_rev_d()
return NULL;
}
b->platform_name_length = strlen(PLATFORM_NAME) + 1;
b->platform_name = (char*) malloc(sizeof(char) * b->platform_name_length);
if (b->platform_name == NULL) {
goto error;
}
strncpy(b->platform_name, PLATFORM_NAME, b->platform_name_length);
b->platform_name = PLATFORM_NAME;
b->phy_pin_count = 20;
b->gpio_count = 14;
b->aio_count = 6;