Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/ftp * consistentnly use memset(a,0,c); there were so...



details:   https://anonhg.NetBSD.org/src/rev/227ce56e3a62
branches:  trunk
changeset: 476828:227ce56e3a62
user:      lukem <lukem%NetBSD.org@localhost>
date:      Wed Sep 29 00:44:01 1999 +0000

description:
* consistentnly use memset(a,0,c); there were some cases of memset(a,'\0',c)
* remove explicit extern int h_errno; it's in <netdb.h>
* add <termios.h> back to util.c; it contains struct winsize on some systems

diffstat:

 usr.bin/ftp/fetch.c |  10 +++++-----
 usr.bin/ftp/ftp.c   |   6 ++----
 usr.bin/ftp/util.c  |   5 +++--
 3 files changed, 10 insertions(+), 11 deletions(-)

diffs (98 lines):

diff -r 325a163a3622 -r 227ce56e3a62 usr.bin/ftp/fetch.c
--- a/usr.bin/ftp/fetch.c       Wed Sep 29 00:34:38 1999 +0000
+++ b/usr.bin/ftp/fetch.c       Wed Sep 29 00:44:01 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fetch.c,v 1.79 1999/09/28 07:51:05 lukem Exp $ */
+/*     $NetBSD: fetch.c,v 1.80 1999/09/29 00:44:01 lukem Exp $ */
 
 /*-
  * Copyright (c) 1997, 1998, 1999 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: fetch.c,v 1.79 1999/09/28 07:51:05 lukem Exp $");
+__RCSID("$NetBSD: fetch.c,v 1.80 1999/09/29 00:44:01 lukem Exp $");
 #endif /* not lint */
 
 /*
@@ -176,7 +176,7 @@
        (void)strlcat(clear, ":", clen);
        (void)strlcat(clear, pass, clen);
        if (gpass == NULL)
-               memset(pass, '\0', strlen(pass));
+               memset(pass, 0, strlen(pass));
 
                                                /* scheme + " " + enc + "\0" */
        rlen = strlen(scheme) + 1 + (clen + 2) * 4 / 3 + 1;
@@ -184,7 +184,7 @@
        (void)strlcpy(*response, scheme, rlen);
        len = strlcat(*response, " ", rlen);
        base64_encode(clear, clen, *response + len);
-       memset(clear, '\0', clen);
+       memset(clear, 0, clen);
        rval = 0;
 
 cleanup_auth_url:
@@ -1000,7 +1000,7 @@
                        if (auth_url(auth, authp, auser, apass) == 0) {
                                rval = fetch_url(url, proxyenv,
                                    proxyauth, wwwauth);
-                               memset(*authp, '\0', strlen(*authp));
+                               memset(*authp, 0, strlen(*authp));
                                FREEPTR(*authp);
                        }
                        goto cleanup_fetch_url;
diff -r 325a163a3622 -r 227ce56e3a62 usr.bin/ftp/ftp.c
--- a/usr.bin/ftp/ftp.c Wed Sep 29 00:34:38 1999 +0000
+++ b/usr.bin/ftp/ftp.c Wed Sep 29 00:44:01 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ftp.c,v 1.69 1999/09/28 07:51:06 lukem Exp $   */
+/*     $NetBSD: ftp.c,v 1.70 1999/09/29 00:44:01 lukem Exp $   */
 
 /*
  * Copyright (C) 1997 and 1998 WIDE Project.
@@ -67,7 +67,7 @@
 #if 0
 static char sccsid[] = "@(#)ftp.c      8.6 (Berkeley) 10/27/94";
 #else
-__RCSID("$NetBSD: ftp.c,v 1.69 1999/09/28 07:51:06 lukem Exp $");
+__RCSID("$NetBSD: ftp.c,v 1.70 1999/09/29 00:44:01 lukem Exp $");
 #endif
 #endif /* not lint */
 
@@ -103,8 +103,6 @@
 
 #include "ftp_var.h"
 
-extern int h_errno;
-
 int    data = -1;
 int    abrtflag = 0;
 jmp_buf        ptabort;
diff -r 325a163a3622 -r 227ce56e3a62 usr.bin/ftp/util.c
--- a/usr.bin/ftp/util.c        Wed Sep 29 00:34:38 1999 +0000
+++ b/usr.bin/ftp/util.c        Wed Sep 29 00:44:01 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: util.c,v 1.67 1999/09/28 09:12:06 lukem Exp $  */
+/*     $NetBSD: util.c,v 1.68 1999/09/29 00:44:01 lukem Exp $  */
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -75,7 +75,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: util.c,v 1.67 1999/09/28 09:12:06 lukem Exp $");
+__RCSID("$NetBSD: util.c,v 1.68 1999/09/29 00:44:01 lukem Exp $");
 #endif /* not lint */
 
 /*
@@ -98,6 +98,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <termios.h>
 #include <time.h>
 #include <tzfile.h>
 #include <unistd.h>



Home | Main Index | Thread Index | Old Index