examples/power: fix string null termination
authorReshma Pattan <reshma.pattan@intel.com>
Tue, 9 Apr 2019 16:00:24 +0000 (17:00 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Mon, 22 Apr 2019 22:15:10 +0000 (00:15 +0200)
commit4c2caea070fb1ceb16688870d44bd4016ce5d0e4
treeaa9c1e205c607e4ca382e28b3bf8e1afca245ddf
parent958d14d38659d96859718657743a963bd6e9f1f4
examples/power: fix string null termination

After the read() the jason_data null termination is missing
for the case "indent < 0", for "indent > 0" and "indent == 0"
cases null termination is already handled.

So add the missing case "indent < 0" to the existing "indent == 0"
case to fix null termination.

Coverity issue: 337680
Fixes: a63504a90f ("examples/power: add JSON string handling")
Cc: stable@dpdk.org
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: David Hunt <david.hunt@intel.com>
examples/vm_power_manager/channel_monitor.c