diff options
author | Wojciech Polak <polak@gnu.org> | 2003-01-03 10:46:12 +0000 |
---|---|---|
committer | Wojciech Polak <polak@gnu.org> | 2003-01-03 10:46:12 +0000 |
commit | 9df95217e34ae81416788997d931f45f29df1f45 (patch) | |
tree | 1e7050cd4dff36a9d84fb9215a9cd55b3a00e85b | |
parent | 945833abb1073a8689978140702afc63746ab854 (diff) | |
download | mailutils-9df95217e34ae81416788997d931f45f29df1f45.tar.gz mailutils-9df95217e34ae81416788997d931f45f29df1f45.tar.bz2 |
Don't use `static char buffer[512]' in pop3d_readline.
-rw-r--r-- | pop3d/extra.c | 11 | ||||
-rw-r--r-- | pop3d/pop3d.c | 7 | ||||
-rw-r--r-- | pop3d/pop3d.h | 6 | ||||
-rw-r--r-- | pop3d/user.c | 7 |
4 files changed, 16 insertions, 15 deletions
diff --git a/pop3d/extra.c b/pop3d/extra.c index 7a66415c7..ab69c8ed4 100644 --- a/pop3d/extra.c +++ b/pop3d/extra.c @@ -1,5 +1,5 @@ /* GNU Mailutils -- a suite of utilities for electronic mail - Copyright (C) 1999, 2001, 2002 Free Software Foundation, Inc. + Copyright (C) 1999, 2001, 2002, 2003 Free Software Foundation, Inc. GNU Mailutils is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -13,7 +13,7 @@ You should have received a copy of the GNU General Public License along with GNU Mailutils; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "pop3d.h" @@ -151,17 +151,16 @@ pop3d_outf (const char *fmt, ...) /* Gets a line of input from the client, caller should free() */ char * -pop3d_readline (FILE *fp) +pop3d_readline (char *buffer, int size) { - static char buffer[512]; char *ptr; alarm (daemon_param.timeout); - ptr = fgets (buffer, sizeof (buffer), fp); + ptr = fgets (buffer, size, ifile); alarm (0); /* We should probably check ferror() too, but if ptr is null we - are done anyway; if (!ptr && ferror(fp)) */ + are done anyway; if (!ptr && ferror(ifile)) */ if (!ptr) pop3d_abquit (ERR_NO_OFILE); diff --git a/pop3d/pop3d.c b/pop3d/pop3d.c index c9f8bdec5..1af6a6acd 100644 --- a/pop3d/pop3d.c +++ b/pop3d/pop3d.c @@ -1,5 +1,5 @@ /* GNU Mailutils -- a suite of utilities for electronic mail - Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. GNU Mailutils is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -13,7 +13,7 @@ You should have received a copy of the GNU General Public License along with GNU Mailutils; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "pop3d.h" @@ -201,6 +201,7 @@ static int pop3d_mainloop (int infile, int outfile) { int status = OK; + char buffer[512]; /* Reset hup to exit. */ signal (SIGHUP, pop3d_signal); @@ -269,7 +270,7 @@ pop3d_mainloop (int infile, int outfile) fflush (ofile); status = OK; - buf = pop3d_readline (ifile); + buf = pop3d_readline (buffer, sizeof (buffer)); cmd = pop3d_cmd (buf); arg = pop3d_args (buf); diff --git a/pop3d/pop3d.h b/pop3d/pop3d.h index d516cd9e5..18f10eb5d 100644 --- a/pop3d/pop3d.h +++ b/pop3d/pop3d.h @@ -1,5 +1,5 @@ /* GNU Mailutils -- a suite of utilities for electronic mail - Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. GNU Mailutils is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -13,7 +13,7 @@ You should have received a copy of the GNU General Public License along with GNU Mailutils; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _POP3D_H #define _POP3D_H 1 @@ -189,7 +189,7 @@ extern int pop3d_list __P ((const char *)); extern int pop3d_lock __P ((void)); extern int pop3d_noop __P ((const char *)); extern int pop3d_quit __P ((const char *)); -extern char *pop3d_readline __P ((FILE *)); +extern char *pop3d_readline __P ((char *, int)); extern int pop3d_retr __P ((const char *)); extern int pop3d_rset __P ((const char *)); extern RETSIGTYPE pop3d_sigchld __P ((int)); diff --git a/pop3d/user.c b/pop3d/user.c index 6c15babb3..a023b0467 100644 --- a/pop3d/user.c +++ b/pop3d/user.c @@ -1,5 +1,5 @@ /* GNU Mailutils -- a suite of utilities for electronic mail - Copyright (C) 1999, 2001, 2002 Free Software Foundation, Inc. + Copyright (C) 1999, 2001, 2002, 2003 Free Software Foundation, Inc. GNU Mailutils is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -13,7 +13,7 @@ You should have received a copy of the GNU General Public License along with GNU Mailutils; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "pop3d.h" @@ -21,6 +21,7 @@ int pop3d_user (const char *arg) { char *buf, pass[POP_MAXCMDLEN], *tmp, *cmd; + char buffer[512]; int status; int lockit = 1; struct mu_auth_data *auth_data; @@ -34,7 +35,7 @@ pop3d_user (const char *arg) pop3d_outf ("+OK\r\n"); fflush (ofile); - buf = pop3d_readline (ifile); + buf = pop3d_readline (buffer, sizeof (buffer)); cmd = pop3d_cmd (buf); tmp = pop3d_args (buf); |