Skip to content

Commit

Permalink
local.c: fix off by one introduced in 3f305ee
Browse files Browse the repository at this point in the history
when moving to iio_strlcpy in local.c during:
3f305ee
we were off by one, so fix that.

Tested over network from FMCOMMS2/Zed Board (running Master) to Windows
(running 0.19 release).

Signed-off-by: Robin Getz <[email protected]>
  • Loading branch information
rgetz committed May 4, 2020
1 parent a0994c5 commit 4fcba7d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion local.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ static int set_channel_name(struct iio_channel *chn)
name = malloc(prefix_len);
if (!name)
return -ENOMEM;
iio_strlcpy(name, attr0, prefix_len - 1);
iio_strlcpy(name, attr0, prefix_len);
IIO_DEBUG("Setting name of channel %s to %s\n", chn->id, name);
chn->name = name;

Expand Down

0 comments on commit 4fcba7d

Please sign in to comment.