X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=command.c;h=84dd1bff8a7132d287638ae2571d1d8935743e77;hp=9f349ee5353c6df5736db1cd2d9c2e115c933248;hb=027f2c1237051d2d569d6be7f381c886f659bac3;hpb=282a5e463090205ef8a12f50a9ecf6498b860e88 diff --git a/command.c b/command.c index 9f349ee5..84dd1bff 100644 --- a/command.c +++ b/command.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1997-2013 Andre Noll + * Copyright (C) 1997-2014 Andre Noll * * Licensed under the GPL v2. For licencing details see COPYING. */ @@ -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); } @@ -842,7 +843,7 @@ static int parse_sb_command(struct command_context *cc, struct iovec *iov) if (ret < 0) goto out; end = iov->iov_base + iov->iov_len; - for (i = 0, p = iov->iov_base; p < end; i++) + for (i = 0; p < end; i++) p += strlen(p) + 1; cc->argc = i; cc->argv = para_malloc((cc->argc + 1) * sizeof(char *));