Skip to content

Commit

Permalink
sync results of local scans and network scans
Browse files Browse the repository at this point in the history
./tests/iio_info -s
Available contexts:
        0: 169.254.231.18 (cpu_thermal,rpi_volt) [ip:raspberrypi.local]
        1: (cpu_thermal, rpi_volt on Raspberry Pi 4 Model B Rev 1.1) [local:]

This will remove the extra space between device names on the local context,
that is not on the network context.

Signed-off-by: Robin Getz <rgetz@mathworks.com>
  • Loading branch information
rgetz authored and pcercuei committed Jul 17, 2023
1 parent f6a452b commit 8492a78
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions local.c
Original file line number Diff line number Diff line change
Expand Up @@ -2177,7 +2177,7 @@ static int build_names(void *d, const char *path)
dst = cat_file(buf);
if (dst) {
len = strnlen(names, sizeof(buf));
iio_snprintf(&names[len], BUF_SIZE - len - 1, "%s, ", dst);
iio_snprintf(&names[len], BUF_SIZE - len - 1, "%s,", dst);
free(dst);
}
return 0;
Expand Down Expand Up @@ -2212,7 +2212,7 @@ int local_context_scan(struct iio_scan_result *scan_result)
if (machine) {
if (names[0]) {
ret = strnlen(names, sizeof(names));
names[ret - 2] = '\0';
names[ret - 1] = '\0';
iio_snprintf(buf, sizeof(buf), "(%s on %s)", names, machine);
} else
iio_snprintf(buf, sizeof(buf), "(Local IIO devices on %s)", machine);
Expand Down

0 comments on commit 8492a78

Please sign in to comment.