From: Pierre Habouzit Date: Tue, 15 May 2007 07:55:06 +0000 (+0200) Subject: simplify pop_query further. X-Git-Url: http://git.madism.org/?a=commitdiff_plain;h=5a44e401b4e50f378f9caa045fe6ad6ca652b758;p=apps%2Fmadmutt.git simplify pop_query further. Signed-off-by: Pierre Habouzit --- diff --git a/pop.c b/pop.c index ea0cb8c..3cfb694 100644 --- a/pop.c +++ b/pop.c @@ -105,16 +105,12 @@ static void pop_error(pop_data_t *pop_data, const char *msg) */ static pop_query_status _pop_query(pop_data_t *pop_data, char *buf, ssize_t buflen) { - char *c; - if (pop_data->status != POP_CONNECTED) return PQ_NOT_CONNECTED; mutt_socket_write(pop_data->conn, buf); - - c = strpbrk(buf, " \r\n"); - *c = '\0'; - snprintf(pop_data->err_msg, sizeof(pop_data->err_msg), "%s: ", buf); + snprintf(pop_data->err_msg, sizeof(pop_data->err_msg), "%.*s: ", + (int)(strpbrk(buf, " \r\n") - buf), buf); if (mutt_socket_readln(buf, buflen, pop_data->conn) < 0) { pop_data->status = POP_DISCONNECTED;