fix a bug in processing of FTP_TIMEOUT environment variable.

Closes PR#2947

Submitted-by: Peter Childs <pjchilds@imforei.apana.org.au>
This commit is contained in:
John-Mark Gurney 1997-03-11 15:13:28 +00:00
parent ccf4742c2f
commit 27e0fa20aa
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=23712

View File

@ -26,7 +26,7 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: ftp.c,v 1.4 1997/03/05 18:57:16 fenner Exp $
* $Id: ftp.c,v 1.5 1997/03/06 10:01:54 jmg Exp $
*/
#include <sys/types.h>
@ -370,7 +370,7 @@ ftp_retrieve(struct fetch_state *fs)
if (env) {
errno = 0;
ul = strtoul(env, &ep, 0);
if (*env && *ep && errno == 0 && ul <= INT_MAX)
if (*env && *ep == '\0' && errno == 0 && ul <= INT_MAX)
fs->fs_timeout = ul;
else
warnx("`%s': invalid FTP timeout", env);