Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: libserialport libxml2
Diff: context.c
- Revision:
- 4:ad69b39bf124
- Parent:
- 3:d147beabba0e
--- a/context.c Mon Jan 30 13:00:39 2017 +0000 +++ b/context.c Mon Jun 26 14:30:10 2017 +0000 @@ -71,7 +71,7 @@ return NULL; } - devices = malloc(ctx->nb_devices * sizeof(*devices)); + devices = calloc(ctx->nb_devices, sizeof(*devices)); if (!devices) goto err_free_devices_len; @@ -119,7 +119,7 @@ return str; err_free_devices: - while (i--) + for (i = 0; i < ctx->nb_devices; i++) free(devices[i]); free(devices); err_free_devices_len: @@ -223,6 +223,9 @@ } } } while (found); + + for (i = 0; i < dev->nb_channels; i++) + dev->channels[i]->number = i; } int iio_context_init(struct iio_context *ctx)