1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

revert "cov: dm stats missed terminating null"

This reverts commit 20971f7034
as the parsing of 'dmstatus' started to fail on present \0 char.
This commit is contained in:
Zdenek Kabelac 2018-10-16 19:13:34 +02:00
parent 2217d6396a
commit 6179cab877

View File

@ -1009,7 +1009,7 @@ static int _stats_parse_list(struct dm_stats *dms, const char *resp)
* dm_task_get_message_response() returns a 'const char *' but * dm_task_get_message_response() returns a 'const char *' but
* since fmemopen also permits "w" it expects a 'char *'. * since fmemopen also permits "w" it expects a 'char *'.
*/ */
if (!(list_rows = fmemopen((char *)resp, strlen(resp) + 1, "r"))) if (!(list_rows = fmemopen((char *)resp, strlen(resp), "r")))
return_0; return_0;
/* begin region table */ /* begin region table */
@ -1240,7 +1240,7 @@ static int _stats_parse_region(struct dm_stats *dms, const char *resp,
* dm_task_get_message_response() returns a 'const char *' but * dm_task_get_message_response() returns a 'const char *' but
* since fmemopen also permits "w" it expects a 'char *'. * since fmemopen also permits "w" it expects a 'char *'.
*/ */
stats_rows = fmemopen((char *)resp, strlen(resp) + 1, "r"); stats_rows = fmemopen((char *)resp, strlen(resp), "r");
if (!stats_rows) if (!stats_rows)
goto_bad; goto_bad;