diff options
author | Ray Lai <ray@cvs.openbsd.org> | 2006-11-07 07:20:17 +0000 |
---|---|---|
committer | Ray Lai <ray@cvs.openbsd.org> | 2006-11-07 07:20:17 +0000 |
commit | a351a7454caa769ce0a3f4b9f12aabcdff3dce5f (patch) | |
tree | eb04239a4ab678a8234a9ad232fe2053ae565625 | |
parent | 73c0b1764af2234e43e12e60a44fc1ec766029ff (diff) |
Don't check buf[strlen(buf) - 1] for zero length strings.
OK jaredy@.
-rw-r--r-- | usr.sbin/rtsold/rtsold.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/rtsold/rtsold.c b/usr.sbin/rtsold/rtsold.c index 634d5ca7228..243aa5f0393 100644 --- a/usr.sbin/rtsold/rtsold.c +++ b/usr.sbin/rtsold/rtsold.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtsold.c,v 1.38 2005/10/28 08:06:39 jmc Exp $ */ +/* $OpenBSD: rtsold.c,v 1.39 2006/11/07 07:20:16 ray Exp $ */ /* $KAME: rtsold.c,v 1.75 2004/01/03 00:00:07 itojun Exp $ */ /* @@ -117,7 +117,7 @@ main(int argc, char *argv[]) argv0 = argv[0]; /* get option */ - if (argv0 && argv0[strlen(argv0) - 1] != 'd') { + if (argv0 && argv0[0] != '\0' && argv0[strlen(argv0) - 1] != 'd') { fflag = 1; once = 1; opts = "adDF"; @@ -654,7 +654,7 @@ rtsold_set_dump_file(int sig) static void usage(char *progname) { - if (progname && progname[strlen(progname) - 1] != 'd') { + if (progname && progname[0] != '\0' && progname[strlen(progname) - 1] != 'd') { fprintf(stderr, "usage: rtsol [-DdF] interface ...\n"); fprintf(stderr, "usage: rtsol [-DdF] -a\n"); } else { |