Doxify error2.c and add GPL header.
[paraslash.git] / command.c
index 33cc4b2f647fce152397471bd7c7441fc30e6ff3..8c746652999ee2f899ed9272eace3f279b313c19 100644 (file)
--- a/command.c
+++ b/command.c
@@ -35,8 +35,8 @@
 #include "signal.h"
 #include "version.h"
 
-struct server_command afs_cmds[] = {DEFINE_AFS_CMD_ARRAY};
-struct server_command server_cmds[] = {DEFINE_SERVER_CMD_ARRAY};
+static struct server_command afs_cmds[] = {DEFINE_AFS_CMD_ARRAY};
+static struct server_command server_cmds[] = {DEFINE_SERVER_CMD_ARRAY};
 
 /** Commands including options must be shorter than this. */
 #define MAX_COMMAND_LEN 32768
@@ -220,8 +220,8 @@ int send_sb(struct stream_cipher_context *scc, void *buf, size_t numbytes,
        int ret;
        struct sb_context *sbc;
        struct iovec iov[2];
-       struct sb_buffer sbb = SBB_INIT(band, buf, numbytes);
        sb_transformation trafo = band < SBD_PROCEED? NULL : sc_trafo;
+       struct sb_buffer sbb = SBB_INIT(band, buf, numbytes);
 
        sbc = sb_new_send(&sbb, dont_free, trafo, scc->send);
        do {
@@ -554,6 +554,7 @@ static int send_list_of_commands(struct command_context *cc, struct server_comma
                msg = para_strcat(msg, tmp);
                free(tmp);
        }
+       assert(msg);
        return send_sb(&cc->scc, msg, strlen(msg), SBD_OUTPUT, false);
 }