From 5a44e401b4e50f378f9caa045fe6ad6ca652b758 Mon Sep 17 00:00:00 2001 From: Pierre Habouzit Date: Tue, 15 May 2007 09:55:06 +0200 Subject: [PATCH] simplify pop_query further. Signed-off-by: Pierre Habouzit --- pop.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) 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; -- 2.20.1