net/failsafe: fix parameters parsing
The corrupted code used wrongly snprintf return value as the
number of characters actually copied, in spite of the meaning
is the number of characters which would be generated for the
given input.
It caused to remain zerod bytes between the failsafe command line
non sub device parameters indicates end of string.
Hence, when rte_kvargs_parse tried to parse all parameters, it
got end of string after the first one and the others weren't parsed.
So, if the mac parameters was the first in command line it was
taken while hotplug_poll was left default, and vice versa.
The fix updates the buffer index by dedicated variable contains
the copy size, by the way validates the comma separation.
Fixes:
a46f8d584eb8 ("net/failsafe: add fail-safe PMD")
Cc: stable@dpdk.org
Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>