From 921ac0e65d2f5e205af3976736f96f5d1db4c67a Mon Sep 17 00:00:00 2001
From: Maarten de Waard <maarten@greenhost.nl>
Date: Tue, 18 Jul 2017 17:27:39 +0200
Subject: [PATCH] resolve discussion about param[out] and return value

---
 src/auxiliary.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/auxiliary.c b/src/auxiliary.c
index 2a38fb0..1271332 100644
--- a/src/auxiliary.c
+++ b/src/auxiliary.c
@@ -195,13 +195,14 @@ int parse_int(const char * input, int * result)
 /**
  * Add the SSH_COMMAND string in front of ssh_key unless it's already there
  * because people have seen it being used in ssh_keys_list.
- * @param[in]   ssh_key a valid ssh key string
+ * @param[out]  ssh_key_with_command    the ssh_key with the command prepended
+ *                                      if needed
+ * @param[in]   ssh_key                 a valid ssh key string
  */
 int add_ssh_command(char ** ssh_key_with_command, const char * ssh_key)
 {
     if(strncmp(SSH_COMMAND, ssh_key, strlen(SSH_COMMAND)) != 0)
-        asprintf(ssh_key_with_command, "%s %s", SSH_COMMAND, ssh_key);
+        return asprintf(ssh_key_with_command, "%s %s", SSH_COMMAND, ssh_key);
     else
-        asprintf(ssh_key_with_command, "%s", ssh_key);
-    return 0;
+        return asprintf(ssh_key_with_command, "%s", ssh_key);
 }
-- 
GitLab