diff options
author | Ray Lai <ray@cvs.openbsd.org> | 2006-03-11 06:52:01 +0000 |
---|---|---|
committer | Ray Lai <ray@cvs.openbsd.org> | 2006-03-11 06:52:01 +0000 |
commit | 7df6fa68506ab78ad29638ee0585b15ed12ba642 (patch) | |
tree | dab260c0a58c43f4ac752b225d53a69004524dd7 /usr.bin/vi | |
parent | 1c03334cd199e6d6c4e67df66453ee527bf436ea (diff) |
Initialize p to NULL to prevent gcc warning.
Clarify a for statement.
ok miod, otto
Diffstat (limited to 'usr.bin/vi')
-rw-r--r-- | usr.bin/vi/ex/ex_write.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/vi/ex/ex_write.c b/usr.bin/vi/ex/ex_write.c index d44e8c51a8a..7f9970f2783 100644 --- a/usr.bin/vi/ex/ex_write.c +++ b/usr.bin/vi/ex/ex_write.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex_write.c,v 1.7 2002/02/17 19:42:34 millert Exp $ */ +/* $OpenBSD: ex_write.c,v 1.8 2006/03/11 06:52:00 ray Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -140,7 +140,7 @@ exwr(sp, cmdp, cmd) { MARK rm; int flags; - char *name, *p; + char *name, *p = NULL; NEEDFILE(sp, cmdp); @@ -151,7 +151,8 @@ exwr(sp, cmdp, cmd) /* Skip any leading whitespace. */ if (cmdp->argc != 0) - for (p = cmdp->argv[0]->bp; *p != '\0' && isblank(*p); ++p); + for (p = cmdp->argv[0]->bp; *p != '\0' && isblank(*p); ++p) + ; /* If "write !" it's a pipe to a utility. */ if (cmdp->argc != 0 && cmd == WRITE && *p == '!') { |