From 931ac3b329c106c9058250b994e6a150c977b606 Mon Sep 17 00:00:00 2001 From: Mark Farrugia Date: Sun, 7 Oct 2018 22:01:09 +1100 Subject: Fix issue with 'map' configfs store The trailing \n was improperly being stored to the 'map' variable Signed-off-by: Mark Farrugia --- configfs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/configfs.c b/configfs.c index cdfd171..7e820c6 100644 --- a/configfs.c +++ b/configfs.c @@ -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; } -- cgit 1.2.3-korg