diff options
author | Mark Farrugia <mark.farrugia@fiberdyne.com.au> | 2018-10-07 22:01:09 +1100 |
---|---|---|
committer | Mark Farrugia <mark.farrugia@fiberdyne.com.au> | 2018-10-26 17:27:38 +1100 |
commit | 931ac3b329c106c9058250b994e6a150c977b606 (patch) | |
tree | 484c1dfaa3f6a44ed29415626b57e33470696ef4 | |
parent | 0acef1799beace4dd38d41bda9df77e84a5fe398 (diff) |
Fix issue with 'map' configfs store
The trailing \n was improperly being stored to the 'map' variable
Signed-off-by: Mark Farrugia <mark.farrugia@fiberdyne.com.au>
-rw-r--r-- | configfs.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -32,9 +32,11 @@ static ssize_t cfg_avirt_stream_map_show(struct config_item *item, char *page) static ssize_t cfg_avirt_stream_map_store(struct config_item *item, const char *page, size_t count) { + char *split; struct avirt_stream *stream = avirt_stream_from_config_item(item); - memcpy(stream->map, (char *)page, count); + split = strsep((char **)&page, "\n"); + memcpy(stream->map, (char *)split, count); return count; } |