Private
Public Access
2
0

mraa.c: Add 3 chars to length of platform_name

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
Brendan Le Foll
2016-02-12 11:27:02 +00:00
parent 944670f66a
commit 1865dd0ba1

View File

@@ -152,7 +152,8 @@ mraa_init()
if (plat != NULL) {
int length = strlen(plat->platform_name) + 1;
if (mraa_has_sub_platform()) {
length += strlen(plat->sub_platform->platform_name);
// Account for ' + ' chars
length += strlen(plat->sub_platform->platform_name) + 3;
}
platform_name = calloc(length, sizeof(char));
if (mraa_has_sub_platform()) {