Skip to content

Commit

Permalink
xml: Init device label when found
Browse files Browse the repository at this point in the history
When the "label" device attribute is found, initialize the device's
label to its value.

Signed-off-by: Paul Cercueil <[email protected]>
  • Loading branch information
pcercuei committed Apr 9, 2021
1 parent 7ef90bc commit 766be67
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions xml.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,8 @@ static struct iio_device * create_device(struct iio_context *ctx, xmlNode *n)
if (!strcmp((char *) attr->name, "name")) {
dev->name = iio_strdup(
(char *) attr->children->content);
} else if (!strcmp((char *) attr->name, "label")) {
dev->label = iio_strdup((char *) attr->children->content);
} else if (!strcmp((char *) attr->name, "id")) {
dev->id = iio_strdup((char *) attr->children->content);
} else {
Expand Down

0 comments on commit 766be67

Please sign in to comment.