Sanitize name
This commit is contained in:
parent
2f4194ec93
commit
d706b26ce4
2 changed files with 7 additions and 2 deletions
|
|
@ -90,6 +90,11 @@ dev_iio_t* dev_iio_create(const char* path) {
|
|||
free(iio);
|
||||
iio = NULL;
|
||||
goto dev_iio_create_err;
|
||||
} else {
|
||||
int idx = strlen(iio->name) - 1;
|
||||
if ((iio->name[idx] == '\n') || ((iio->name[idx] == '\t'))) {
|
||||
iio->name[idx] = '\0';
|
||||
}
|
||||
}
|
||||
// ==========================================================================================================
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue