summary |
tags |
clone url |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
5abd965)
SCCS-vsn: usr.bin/netstat/main.c 4.5
SCCS-vsn: usr.bin/rlogin/rlogin.c 4.9
SCCS-vsn: usr.bin/rsh/rsh.c 4.6
-static char sccsid[] = "@(#)main.c 4.4 82/12/24";
+static char sccsid[] = "@(#)main.c 4.5 83/02/09";
#endif
#include <sys/param.h>
#endif
#include <sys/param.h>
if (kflag) {
/* get kernel pte */
if (kflag) {
/* get kernel pte */
- base = Sysmap[base >> 9].pg_pfnum * 512 + (base & 0x1ff);
+#endif
+ base = ctob(Sysmap[btoc(base)].pg_pfnum) + (base & (NBPG-1));
}
lseek(fd, base, off);
}
}
lseek(fd, base, off);
}
-static char sccsid[] = "@(#)rlogin.c 4.8 83/01/18";
+static char sccsid[] = "@(#)rlogin.c 4.9 83/02/09";
#endif
#include <sys/types.h>
#endif
#include <sys/types.h>
if (!strcmp(host, "rlogin"))
host = *argv++, --argc;
another:
if (!strcmp(host, "rlogin"))
host = *argv++, --argc;
another:
- if (!strcmp(*argv, "-d")) {
+ if (argc > 0 && !strcmp(*argv, "-d")) {
argv++, argc--;
options |= SO_DEBUG;
goto another;
}
argv++, argc--;
options |= SO_DEBUG;
goto another;
}
- if (!strcmp(*argv, "-l")) {
+ if (argc > 0 && !strcmp(*argv, "-l")) {
argv++, argc--;
if (argc == 0)
goto usage;
name = *argv++; argc--;
goto another;
}
argv++, argc--;
if (argc == 0)
goto usage;
name = *argv++; argc--;
goto another;
}
- if (!strncmp(*argv, "-e", 2)) {
+ if (argc > 0 && !strncmp(*argv, "-e", 2)) {
cmdchar = argv[0][2];
argv++, argc--;
goto another;
}
cmdchar = argv[0][2];
argv++, argc--;
goto another;
}
- if (!strcmp(*argv, "-8")) {
+ if (argc > 0 && !strcmp(*argv, "-8")) {
eight = 1;
argv++, argc--;
goto another;
eight = 1;
argv++, argc--;
goto another;
char waste[BUFSIZ], mark;
signal(SIGURG, oob);
ioctl(1, TIOCFLUSH, (char *)&out);
for (;;) {
char waste[BUFSIZ], mark;
signal(SIGURG, oob);
ioctl(1, TIOCFLUSH, (char *)&out);
for (;;) {
- if (ioctl(rem, SIOCATMARK, &mark) < 0) {
+ if (ioctl(rem, SIOCATMARK, &atmark) < 0) {
perror("ioctl");
break;
}
perror("ioctl");
break;
}
break;
(void) read(rem, waste, sizeof (waste));
}
break;
(void) read(rem, waste, sizeof (waste));
}
-static char sccsid[] = "@(#)rsh.c 4.5 83/01/30";
+static char sccsid[] = "@(#)rsh.c 4.6 83/02/09";
#endif
#include <sys/types.h>
#endif
#include <sys/types.h>
- if (!strcmp(*argv, "-l")) {
+ if (argc > 0 && !strcmp(*argv, "-l")) {
argv++, argc--;
if (argc > 0)
user = *argv++, argc--;
goto another;
}
argv++, argc--;
if (argc > 0)
user = *argv++, argc--;
goto another;
}
- if (!strcmp(*argv, "-n")) {
+ if (argc > 0 && !strcmp(*argv, "-n")) {
argv++, argc--;
(void) close(0);
(void) open("/dev/null", 0);
goto another;
}
argv++, argc--;
(void) close(0);
(void) open("/dev/null", 0);
goto another;
}
- if (!strcmp(*argv, "-d")) {
+ if (argc > 0 && !strcmp(*argv, "-d")) {
argv++, argc--;
options |= SO_DEBUG;
goto another;
argv++, argc--;
options |= SO_DEBUG;
goto another;
* Ignore the -e flag to allow aliases with rlogin
* to work
*/
* Ignore the -e flag to allow aliases with rlogin
* to work
*/
- if (!strncmp(*argv, "-e", 2)) {
+ if (argc > 0 && !strncmp(*argv, "-e", 2)) {
argv++, argc--;
goto another;
}
argv++, argc--;
goto another;
}