/* pop.c: client routines for talking to a POP3-protocol post-office server
-Copyright (C) 1991, 1993, 1996-1997, 1999, 2001-2011
+Copyright (C) 1991, 1993, 1996-1997, 1999, 2001-2012
Free Software Foundation, Inc.
Author: Jonathan Kamens <jik@security.ov.com>
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#else
-#define MAIL_USE_POP
-#endif
#ifdef MAIL_USE_POP
#endif /* KERBEROS */
#ifndef WINDOWSNT
-#if !defined (HAVE_H_ERRNO) || !defined (HAVE_CONFIG_H)
+#ifndef HAVE_H_ERRNO
extern int h_errno;
#endif
#endif
if (0 == strncmp (fromserver, "-ERR", 4))
{
strncpy (pop_error, fromserver, ERROR_MAX);
+ pop_error[ERROR_MAX-1] = '\0';
}
else
{
if (strncmp (fromserver, "+OK ", 4))
{
if (! strncmp (fromserver, "-ERR", 4))
- strncpy (pop_error, fromserver, ERROR_MAX);
+ {
+ strncpy (pop_error, fromserver, ERROR_MAX);
+ pop_error[ERROR_MAX-1] = '\0';
+ }
else
{
strcpy (pop_error,
if (0 == strncmp (*response, "-ERR", 4))
{
strncpy (pop_error, *response, ERROR_MAX);
+ pop_error[ERROR_MAX-1] = '\0';
return (-1);
}
else if (0 == strncmp (*response, "+OK", 3))
if (! strncmp (fromserver, "-ERR", 4))
{
strncpy (pop_error, fromserver, ERROR_MAX);
+ pop_error[ERROR_MAX-1] = '\0';
return (-1);
}
else if (strncmp (fromserver, "+OK ", 4))