bcopy/bzero/bcmp/index/rindex are marked LEGACY in SuSv3.
They are replaced as proposed by SuSv3.

Signed-off-by: Thomas Chou <[EMAIL PROTECTED]>

diff --git a/user/telnetd/authenc.c b/user/telnetd/authenc.c
index 301b770..e14c7b1 100644
--- a/user/telnetd/authenc.c
+++ b/user/telnetd/authenc.c
@@ -26,6 +26,7 @@ char authenc_rcsid[] =
 #endif
 
 #if    defined(ENCRYPT) || defined(AUTHENTICATE)
+#include <string.h>
 #include "telnetd.h"
 #include <libtelnet/misc.h>
 
@@ -35,7 +36,7 @@ net_write(str, len)
     int len;
 {
     if (nfrontp + len < netobuf + BUFSIZ) {
-       bcopy((void *)str, (void *)nfrontp, len);
+       memmove((void *)nfrontp,(void *)str,  len);
        nfrontp += len;
        return(len);
     }
diff --git a/user/telnetd/logout.c b/user/telnetd/logout.c
index 23d2873..9f82ccc 100644
--- a/user/telnetd/logout.c
+++ b/user/telnetd/logout.c
@@ -67,8 +67,8 @@ logout(const char *line)
                if (!ut.ut_name[0] || strncmp(ut.ut_line, line, UT_LINESIZE))
                        continue;
                ut.ut_type = DEAD_PROCESS;
-               bzero(ut.ut_name, UT_NAMESIZE);
-               bzero(ut.ut_host, UT_HOSTSIZE);
+               memset(ut.ut_name, 0, UT_NAMESIZE);
+               memset(ut.ut_host, 0, UT_HOSTSIZE);
                (void)time(&ut.ut_time);
                (void)lseek(fd, -(off_t)sizeof(UTMP), L_INCR);
                (void)write(fd, &ut, sizeof(UTMP));
diff --git a/user/telnetd/slc.c b/user/telnetd/slc.c
index 2edc74d..3079f9a 100644
--- a/user/telnetd/slc.c
+++ b/user/telnetd/slc.c
@@ -39,6 +39,7 @@ char slc_rcsid[] =
   "$Id: slc.c,v 1.2 2003/07/21 03:11:25 davidm Exp $";
 #endif
 
+#include <string.h>
 #include "telnetd.h"
 
 #ifdef LINEMODE
@@ -428,7 +429,7 @@ void do_opt_slc(unsigned char  *ptr, int len) {
            def_slclen = len;
            def_slcbuf = malloc((unsigned)len);
            if (def_slcbuf == NULL) return;  /* too bad */
-           bcopy(ptr, def_slcbuf, len);
+           memset(def_slcbuf, ptr, len);
        }
     }
 }
diff --git a/user/telnetd/state.c b/user/telnetd/state.c
index 3954d74..6d64d5e 100644
--- a/user/telnetd/state.c
+++ b/user/telnetd/state.c
@@ -39,6 +39,7 @@ char state_rcsid[] =
   "$Id: state.c,v 1.3 2003/08/14 05:03:37 gerg Exp $";
 #endif
 
+#include <string.h>
 #include "telnetd.h"
 
 int not42 = 1;
@@ -357,7 +358,7 @@ void telrcv(void) {
        char xbuf2[BUFSIZ];
        register char *cp;
        int n = pfrontp - opfrontp, oc;
-       bcopy(opfrontp, xptyobuf, n);
+       memmove(xptyobuf, opfrontp, n);
        pfrontp = opfrontp;
        pfrontp += term_input(xptyobuf, pfrontp, n, BUFSIZ+NETSLOP,
                              xbuf2, &oc, BUFSIZ);
diff --git a/user/telnetd/sys_term.c b/user/telnetd/sys_term.c
index da352da..9261e0c 100644
--- a/user/telnetd/sys_term.c
+++ b/user/telnetd/sys_term.c
@@ -39,6 +39,7 @@ char st_rcsid[] =
   "$Id: sys_term.c,v 1.8 2004/12/06 22:35:28 davidm Exp $";
 #endif
 
+#include <string.h>
 #include "telnetd.h"
 #include "pathnames.h"
 #include "logout.h"
@@ -205,7 +206,7 @@ void init_termbuf(void) {
 #if defined(LINEMODE) && defined(TIOCPKT_IOCTL)
 void copy_termbuf(char *cp, int len) {
     if (len > sizeof(termbuf)) len = sizeof(termbuf);
-    bcopy(cp, (char *)&termbuf, len);
+    memmove((char *)&termbuf, cp, len);
     termbuf2 = termbuf;
 }
 #endif /* defined(LINEMODE) && defined(TIOCPKT_IOCTL) */
@@ -215,11 +216,11 @@ void set_termbuf(void) {
      * Only make the necessary changes.
      */
 #ifndef        USE_TERMIO
-    if (bcmp((char *)&termbuf.sg, (char *)&termbuf2.sg, sizeof(termbuf.sg)))
+    if (memcmp((char *)&termbuf.sg, (char *)&termbuf2.sg, sizeof(termbuf.sg)))
        (void) ioctl(pty, TIOCSETN, (char *)&termbuf.sg);
-    if (bcmp((char *)&termbuf.tc, (char *)&termbuf2.tc, sizeof(termbuf.tc)))
+    if (memcmp((char *)&termbuf.tc, (char *)&termbuf2.tc, sizeof(termbuf.tc)))
        (void) ioctl(pty, TIOCSETC, (char *)&termbuf.tc);
-    if (bcmp((char *)&termbuf.ltc, (char *)&termbuf2.ltc, sizeof(termbuf.ltc)))
+    if (memcmp((char *)&termbuf.ltc, (char *)&termbuf2.ltc, 
sizeof(termbuf.ltc)))
        (void) ioctl(pty, TIOCSLTC, (char *)&termbuf.ltc);
     if (termbuf.lflags != termbuf2.lflags)
        (void) ioctl(pty, TIOCLSET, (char *)&termbuf.lflags);
@@ -952,7 +953,7 @@ static int getptyslave(void) {
     init_termbuf();
 # ifdef        TIOCGWINSZ
     if (def_row || def_col) {
-       bzero((char *)&ws, sizeof(ws));
+       memset((char *)&ws, 0, sizeof(ws));
        ws.ws_col = def_col;
        ws.ws_row = def_row;
        ioctl(t, TIOCSWINSZ, (char *)&ws);
diff --git a/user/telnetd/telnetd.c b/user/telnetd/telnetd.c
index 4662e25..b189678 100644
--- a/user/telnetd/telnetd.c
+++ b/user/telnetd/telnetd.c
@@ -43,6 +43,7 @@ char telnetd_rcsid[] =
   "$Original-Id: telnetd.c,v 1.9 1996/12/29 18:16:33 dholland Exp $";
 #endif
 
+#include <string.h>
 #include <netdb.h>
 #ifdef TERMCAP
 #include <termcap.h>
@@ -498,24 +499,24 @@ getterminaltype(char *name)
     if (his_state_is_will(TELOPT_TSPEED)) {
        static char sbbuf[] = { IAC, SB, TELOPT_TSPEED, TELQUAL_SEND, IAC, SE };
 
-       bcopy(sbbuf, nfrontp, sizeof sbbuf);
+       memmove(nfrontp, sbbuf, sizeof sbbuf);
        nfrontp += sizeof sbbuf;
     }
     if (his_state_is_will(TELOPT_XDISPLOC)) {
        static char sbbuf[] = { IAC, SB, TELOPT_XDISPLOC, TELQUAL_SEND, IAC, SE 
};
 
-       bcopy(sbbuf, nfrontp, sizeof sbbuf);
+       memmove(nfrontp, sbbuf, sizeof sbbuf);
        nfrontp += sizeof sbbuf;
     }
     if (his_state_is_will(TELOPT_ENVIRON)) {
        static char sbbuf[] = { IAC, SB, TELOPT_ENVIRON, TELQUAL_SEND, IAC, SE 
};
 
-       bcopy(sbbuf, nfrontp, sizeof sbbuf);
+       memmove(nfrontp, sbbuf, sizeof sbbuf);
        nfrontp += sizeof sbbuf;
     }
     if (his_state_is_will(TELOPT_TTYPE)) {
 
-       bcopy(ttytype_sbbuf, nfrontp, sizeof ttytype_sbbuf);
+       memmove(nfrontp, ttytype_sbbuf, sizeof ttytype_sbbuf);
        nfrontp += sizeof ttytype_sbbuf;
     }
     if (his_state_is_will(TELOPT_TSPEED)) {
@@ -586,7 +587,7 @@ _gettermname(void)
     if (his_state_is_wont(TELOPT_TTYPE))
        return;
     settimer(baseline);
-    bcopy(ttytype_sbbuf, nfrontp, sizeof ttytype_sbbuf);
+    memmove(nfrontp, ttytype_sbbuf, sizeof ttytype_sbbuf);
     nfrontp += sizeof ttytype_sbbuf;
     while (sequenceIs(ttypesubopt, baseline))
        ttloop();
diff --git a/user/telnetd/termstat.c b/user/telnetd/termstat.c
index 54edfda..2ffda65 100644
--- a/user/telnetd/termstat.c
+++ b/user/telnetd/termstat.c
@@ -39,6 +39,7 @@ char termstat_rcsid[] =
   "$Id: termstat.c,v 1.2 2003/07/21 03:11:25 davidm Exp $";
 #endif
 
+#include <string.h>
 #include "telnetd.h"
 
 /*
@@ -605,7 +606,7 @@ defer_terminit()
        if (def_col || def_row) {
                struct winsize ws;
 
-               bzero((char *)&ws, sizeof(ws));
+               memset((char *)&ws, 0, sizeof(ws));
                ws.ws_col = def_col;
                ws.ws_row = def_row;
                (void) ioctl(pty, TIOCSWINSZ, (char *)&ws);
diff --git a/user/telnetd/utility.c b/user/telnetd/utility.c
index 69e3cf0..9fb6da1 100644
--- a/user/telnetd/utility.c
+++ b/user/telnetd/utility.c
@@ -41,6 +41,7 @@ char util_rcsid[] =
 
 #define PRINTOPTIONS
 
+#include <string.h>
 #include <sys/utsname.h>
 
 #ifdef AUTHENTICATE
@@ -230,7 +231,7 @@ netclear()
                next = nextitem(next);
            } while (wewant(next) && (nfrontp > next));
            length = next-thisitem;
-           bcopy(thisitem, good, length);
+           memmove(good, thisitem, length);
            good += length;
            thisitem = next;
        } else {
@@ -337,7 +338,7 @@ writenet(ptr, len)
                netflush();
        }
 
-       bcopy(ptr, nfrontp, len);
+       memmove(nfrontp, ptr, len);
        nfrontp += len;
 
 }  /* end of writenet */
@@ -457,7 +458,7 @@ putf(const char *cp, char *where)
                switch (*++cp) {
 
                case 't':
-                       slash = rindex(line, '/');
+                       slash = strrchr(line, '/');
                        if (slash == (char *) 0)
                                putstr(line);
                        else
-- 
1.5.3.3

_______________________________________________
uClinux-dev mailing list
[email protected]
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by [email protected]
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

Reply via email to