/* pop.c: client routines for talking to a POP3-protocol post-office server
-Copyright (C) 1991, 1993, 1996-1997, 1999, 2001-2013 Free Software
+Copyright (C) 1991, 1993, 1996-1997, 1999, 2001-2016 Free Software
Foundation, Inc.
Author: Jonathan Kamens <jik@security.ov.com>
GNU Emacs is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
+the Free Software Foundation, either version 3 of the License, or (at
+your option) any later version.
GNU Emacs is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
#endif
#include <pop.h>
-#ifdef sun
-#include <malloc.h>
-#endif /* sun */
-
#ifdef HESIOD
#include <hesiod.h>
/*
#endif
char pop_error[ERROR_MAX];
-int pop_debug = 0;
+bool pop_debug = false;
/*
* Function: pop_open (char *host, char *username, char *password,
server->data = 0;
server->buffer_index = 0;
server->buffer_size = GETLINE_MIN;
- server->in_multi = 0;
- server->trash_started = 0;
+ server->in_multi = false;
+ server->trash_started = false;
if (getok (server))
return (0);
else if (0 == strncmp (*response, "+OK", 3))
{
for (*response += 3; **response == ' '; (*response)++) /* empty */;
- server->in_multi = 1;
+ server->in_multi = true;
return (0);
}
else
if (! fromserver[1])
{
*line = 0;
- server->in_multi = 0;
+ server->in_multi = false;
return (0);
}
else
{
int errlen = err_ret->text.length;
snprintf (pop_error + pop_error_len, ERROR_MAX - pop_error_len,
- " [server says '.*%s']", errlen, err_ret->text.data);
+ " [server says '%.*s']", errlen, err_ret->text.data);
}
#elif defined HAVE_KRB5_ERROR_E_TEXT
if (err_ret && err_ret->e_text && **err_ret->e_text)
over a few dozen messages, and is a big chunk of the time we
spend fetching mail from a server close by. */
buf = alloca (strlen (line) + 3);
- strcpy (buf, line);
- strcat (buf, "\r\n");
+ strcpy (stpcpy (buf, line), "\r\n");
ret = fullwrite (server->file, buf, strlen (buf));
if (ret < 0)
/* avoid recursion; sendline can call pop_trash */
if (server->trash_started)
return;
- server->trash_started = 1;
+ server->trash_started = true;
sendline (server, "RSET");
sendline (server, "QUIT");