Code

frontend: Clear the error buffer when initializing a new command.
authorSebastian Harl <sh@tokkee.org>
Thu, 24 Apr 2014 07:20:19 +0000 (09:20 +0200)
committerSebastian Harl <sh@tokkee.org>
Thu, 24 Apr 2014 07:20:19 +0000 (09:20 +0200)
src/frontend/connection.c

index 8d7123a1beb13ab77956403659c8be8d81bfdc01..3d288410ee357ae4317477e255791afbc5bb5251 100644 (file)
@@ -271,9 +271,6 @@ command_handle(sdb_conn_t *conn)
                return -1;
        }
 
-       /* reset */
-       sdb_strbuf_sprintf(conn->errbuf, "");
-
        switch (conn->cmd) {
                case CONNECTION_PING:
                        status = sdb_connection_ping(conn);
@@ -371,6 +368,9 @@ command_init(sdb_conn_t *conn)
 
        assert(conn && (conn->cmd == CONNECTION_IDLE) && (! conn->cmd_len));
 
+       /* reset */
+       sdb_strbuf_sprintf(conn->errbuf, "");
+
        conn->cmd = connection_get_int32(conn, 0);
        conn->cmd_len = connection_get_int32(conn, sizeof(uint32_t));