From c8fdc5c0877b137ed3ca1f217d8ef0fa89299a9a Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Fri, 25 Aug 2017 11:53:26 +0200 Subject: [PATCH] cleanup: easier to read code Split into lines for better reading. --- daemons/clvmd/clvmd-command.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/daemons/clvmd/clvmd-command.c b/daemons/clvmd/clvmd-command.c index cf19dc24b..2971ecba5 100644 --- a/daemons/clvmd/clvmd-command.c +++ b/daemons/clvmd/clvmd-command.c @@ -171,8 +171,10 @@ int do_command(struct local_client *client, struct clvm_header *msg, int msglen, /* Check the status of the command and return the error text */ if (status) { - *retlen = 1 + ((*buf) ? dm_snprintf(*buf, buflen, "%s", - strerror(status)) : -1); + if (*buf) + *retlen = dm_snprintf(*buf, buflen, "%s", strerror(status)) + 1; + else + *retlen = 0; } return status; -- 2.43.5