From: Diego Nieto Cid <[email protected]>
../../utils/mount.c: In function 'do_query':
../../utils/mount.c:589:15: warning: ignoring return value of 'asprintf'
declared with attribute 'warn_unused_result' [-Wunused-result]
---
utils/mount.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/utils/mount.c b/utils/mount.c
index 898e0569..d63e89b5 100644
--- a/utils/mount.c
+++ b/utils/mount.c
@@ -586,8 +586,11 @@ do_query (struct fs *fs)
opts_len -= strlen (device) + 1;
if (!strncmp (type_opt, argv[nopts - 1], sizeof type_opt - 1))
{
- asprintf ((char **) &device, "%s:%s",
- &argv[nopts - 1][sizeof type_opt - 1], device);
+ err = asprintf ((char **) &device, "%s:%s",
+ &argv[nopts - 1][sizeof type_opt - 1], device);
+ if (err == -1)
+ error (1, errno, "asprintf failed");
+
opts_len -= strlen (argv[nopts - 1]) + 1;
}
}
--
2.51.0