From d10584888038afb855099feebb117492c48d156c Mon Sep 17 00:00:00 2001 From: root Date: Wed, 13 Mar 2019 14:49:08 +0800 Subject: [PATCH 17/17] dmsetup: Fix multi-line concise table parsing Use the correct loop variable within the loop, instead of reusing the initial value. Table lines after the first don't get terminated in the right place. Signed-off-by: Kurt Garloff (cherry picked from commit ccfbd505fea2f259f7c89dc23b020b838363a611) --- tools/dmsetup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/dmsetup.c b/tools/dmsetup.c index d47484b..55fbd95 100644 --- a/tools/dmsetup.c +++ b/tools/dmsetup.c @@ -367,7 +367,7 @@ static int _parse_table_lines(struct dm_task *dmt) do { /* Identify and terminate each line */ - if ((next_pos = strchr(_table, '\n'))) + if ((next_pos = strchr(pos, '\n'))) *next_pos++ = '\0'; if (!_parse_line(dmt, pos, "", ++line)) return_0; -- 2.19.1