summaryrefslogtreecommitdiffstats
path: root/configfs.c
diff options
context:
space:
mode:
authorMark Farrugia <mark.farrugia@fiberdyne.com.au>2018-10-07 22:01:09 +1100
committerMark Farrugia <mark.farrugia@fiberdyne.com.au>2018-10-26 17:27:38 +1100
commit931ac3b329c106c9058250b994e6a150c977b606 (patch)
tree484c1dfaa3f6a44ed29415626b57e33470696ef4 /configfs.c
parent0acef1799beace4dd38d41bda9df77e84a5fe398 (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>
Diffstat (limited to 'configfs.c')
-rw-r--r--configfs.c4
1 files changed, 3 insertions, 1 deletions
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;
}