]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
utils/client/kresc.c: replace asserts
authorTomas Krizek <tomas.krizek@nic.cz>
Wed, 24 Mar 2021 16:44:49 +0000 (17:44 +0100)
committerTomas Krizek <tomas.krizek@nic.cz>
Tue, 25 May 2021 12:39:44 +0000 (14:39 +0200)
utils/client/kresc.c

index 5ca9638354ce4b27d15d7b2dd08f2b949f8936f6..1c8615e760a7493d489e925490c4d3e0d915d0fb 100644 (file)
@@ -2,7 +2,6 @@
  *  SPDX-License-Identifier: GPL-3.0-or-later
  */
 #include <arpa/inet.h>
-#include <assert.h>
 #include <contrib/ccan/asprintf/asprintf.h>
 #include <editline/readline.h>
 #include <errno.h>
@@ -325,10 +324,8 @@ static int init_tty(const char *path)
 //! Run a command on the daemon; return the answer or NULL on failure, puts answer length to out_len.
 static char *run_cmd(const char *cmd, size_t * out_len)
 {
-       if (!g_tty || !cmd) {
-               assert(false);
+       if (!g_tty || !cmd)
                return NULL;
-       }
        if (fprintf(g_tty, "%s", cmd) < 0 || fflush(g_tty))
                return NULL;
        uint32_t len;