Private
Public Access
2
0

mraa.c: Use mraa_atoi instead of atoi in lockfile adding

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
Brendan Le Foll
2016-10-27 14:36:43 +01:00
parent 4a33aca8fd
commit fa35855bb6

View File

@@ -1144,7 +1144,9 @@ mraa_add_from_lockfile(const char* imraa_lock_file)
struct json_object *ioobj = json_object_array_get_idx(ioarray, i);
json_object_object_foreach(ioobj, key, val) {
if (strcmp(key, "id") == 0) {
id = atoi(json_object_get_string(val));
if (mraa_atoi(json_object_get_string(val), &id) != MRAA_SUCCESS) {
id = -1;
}
} else if (strcmp(key, "uart") == 0) {
uartdev = json_object_get_string(val);
}