summaryrefslogtreecommitdiff
path: root/bin/ksh
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2015-09-18 07:28:25 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2015-09-18 07:28:25 +0000
commit375e1476fbe2e5c2a235492f76eedab9c7850107 (patch)
tree9905f7f1d5132ec7a205fbedee4ed5fbbe32f370 /bin/ksh
parentd8637bba15d281c3dfe5addcf569236fd191fd1b (diff)
Last of the (thing *)0 -> NULL, from Michael McConville. No binary
change.
Diffstat (limited to 'bin/ksh')
-rw-r--r--bin/ksh/c_ksh.c10
-rw-r--r--bin/ksh/c_sh.c8
-rw-r--r--bin/ksh/c_test.c10
-rw-r--r--bin/ksh/edit.c6
-rw-r--r--bin/ksh/emacs.c4
-rw-r--r--bin/ksh/eval.c10
-rw-r--r--bin/ksh/exec.c16
-rw-r--r--bin/ksh/expr.c8
-rw-r--r--bin/ksh/io.c6
-rw-r--r--bin/ksh/lex.c4
-rw-r--r--bin/ksh/main.c22
-rw-r--r--bin/ksh/misc.c4
-rw-r--r--bin/ksh/shf.c4
-rw-r--r--bin/ksh/syn.c8
-rw-r--r--bin/ksh/table.c4
-rw-r--r--bin/ksh/trap.c4
-rw-r--r--bin/ksh/var.c6
-rw-r--r--bin/ksh/vi.c4
18 files changed, 68 insertions, 70 deletions
diff --git a/bin/ksh/c_ksh.c b/bin/ksh/c_ksh.c
index b7476abb4f8..491ac4c9af5 100644
--- a/bin/ksh/c_ksh.c
+++ b/bin/ksh/c_ksh.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: c_ksh.c,v 1.40 2015/09/15 18:15:05 tedu Exp $ */
+/* $OpenBSD: c_ksh.c,v 1.41 2015/09/18 07:28:24 nicm Exp $ */
/*
* built-in Korn commands: c_*
@@ -876,7 +876,7 @@ c_alias(char **wp)
/* "hash -r" means reset all the tracked aliases.. */
if (rflag) {
static const char *const args[] = {
- "unalias", "-ta", (const char *) 0
+ "unalias", "-ta", NULL
};
if (!tflag || *wp) {
@@ -940,7 +940,7 @@ c_alias(char **wp)
afree(ap->val.s, APERM);
}
/* ignore values for -t (at&t ksh does this) */
- newval = tflag ? search(alias, path, X_OK, (int *) 0) :
+ newval = tflag ? search(alias, path, X_OK, NULL) :
val;
if (newval) {
ap->val.s = str_save(newval, APERM);
@@ -1123,7 +1123,7 @@ kill_fmt_entry(void *arg, int i, char *buf, int buflen)
int
c_kill(char **wp)
{
- Trap *t = (Trap *) 0;
+ Trap *t = NULL;
char *p;
int lflag = 0;
int i, n, rv, sig;
@@ -1270,7 +1270,7 @@ c_getopts(char **wp)
return 1;
}
- if (e->loc->next == (struct block *) 0) {
+ if (e->loc->next == NULL) {
internal_errorf(0, "c_getopts: no argv");
return 1;
}
diff --git a/bin/ksh/c_sh.c b/bin/ksh/c_sh.c
index 995a76e64b6..18f99c898b6 100644
--- a/bin/ksh/c_sh.c
+++ b/bin/ksh/c_sh.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: c_sh.c,v 1.48 2015/09/17 14:21:33 nicm Exp $ */
+/* $OpenBSD: c_sh.c,v 1.49 2015/09/18 07:28:24 nicm Exp $ */
/*
* built-in Bourne commands
@@ -204,7 +204,7 @@ c_dot(char **wp)
;
} else {
argc = 0;
- argv = (char **) 0;
+ argv = NULL;
}
i = include(file, argc, argv, 0);
if (i < 0) { /* should not happen */
@@ -351,7 +351,7 @@ c_read(char **wp)
/* set prompt in case this is
* called from .profile or $ENV
*/
- set_prompt(PS2, (Source *) 0);
+ set_prompt(PS2, NULL);
pprompt(prompt, 0);
}
} else if (c != EOF)
@@ -542,7 +542,7 @@ int
c_brkcont(char **wp)
{
int n, quit;
- struct env *ep, *last_ep = (struct env *) 0;
+ struct env *ep, *last_ep = NULL;
char *arg;
if (ksh_getopt(wp, &builtin_opt, null) == '?')
diff --git a/bin/ksh/c_test.c b/bin/ksh/c_test.c
index 478e29d6266..de9cdff20f7 100644
--- a/bin/ksh/c_test.c
+++ b/bin/ksh/c_test.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: c_test.c,v 1.19 2015/09/15 18:15:05 tedu Exp $ */
+/* $OpenBSD: c_test.c,v 1.20 2015/09/18 07:28:24 nicm Exp $ */
/*
* test(1); version 7-like -- author Erik Baalbergen
@@ -471,7 +471,7 @@ test_primary(Test_env *te, int do_eval)
return 0;
}
- return (*te->eval)(te, op, opnd1, (const char *) 0,
+ return (*te->eval)(te, op, opnd1, NULL,
do_eval);
}
}
@@ -494,7 +494,7 @@ test_primary(Test_env *te, int do_eval)
(*te->error)(te, -1, "missing expression operator");
return 0;
}
- return (*te->eval)(te, TO_STNZE, opnd1, (const char *) 0, do_eval);
+ return (*te->eval)(te, TO_STNZE, opnd1, NULL, do_eval);
}
/*
@@ -535,7 +535,7 @@ static const char *
ptest_getopnd(Test_env *te, Test_op op, int do_eval)
{
if (te->pos.wp >= te->wp_end)
- return op == TO_FILTT ? "1" : (const char *) 0;
+ return op == TO_FILTT ? "1" : NULL;
return *te->pos.wp++;
}
@@ -550,7 +550,7 @@ static void
ptest_error(Test_env *te, int offset, const char *msg)
{
const char *op = te->pos.wp + offset >= te->wp_end ?
- (const char *) 0 : te->pos.wp[offset];
+ NULL : te->pos.wp[offset];
te->flags |= TEF_ERROR;
if (op)
diff --git a/bin/ksh/edit.c b/bin/ksh/edit.c
index c5ae4a1d400..2e00727b1e5 100644
--- a/bin/ksh/edit.c
+++ b/bin/ksh/edit.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: edit.c,v 1.43 2015/09/17 14:21:33 nicm Exp $ */
+/* $OpenBSD: edit.c,v 1.44 2015/09/18 07:28:24 nicm Exp $ */
/*
* Command line editing - common code
@@ -459,7 +459,7 @@ x_command_glob(int flags, const char *str, int slen, char ***wordsp)
nwords = XPsize(w);
if (!nwords) {
- *wordsp = (char **) 0;
+ *wordsp = NULL;
XPfree(w);
return 0;
}
@@ -593,7 +593,7 @@ x_cf_glob(int flags, const char *buf, int buflen, int pos, int *startp,
nwords = (is_command ? x_command_glob : x_file_glob)(flags,
buf + *startp, len, &words);
if (nwords == 0) {
- *wordsp = (char **) 0;
+ *wordsp = NULL;
return 0;
}
diff --git a/bin/ksh/emacs.c b/bin/ksh/emacs.c
index 71200736eb5..542f7c541b0 100644
--- a/bin/ksh/emacs.c
+++ b/bin/ksh/emacs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: emacs.c,v 1.52 2015/09/10 22:48:58 nicm Exp $ */
+/* $OpenBSD: emacs.c,v 1.53 2015/09/18 07:28:24 nicm Exp $ */
/*
* Emacs-like command line editing and history
@@ -1019,7 +1019,7 @@ x_redraw(int limit)
x_e_putc('\r');
x_flush();
if (xbp == xbuf) {
- x_col = promptlen(prompt, (const char **) 0);
+ x_col = promptlen(prompt, NULL);
if (x_col > xx_cols)
truncate = (x_col / xx_cols) * xx_cols;
if (prompt_redraw)
diff --git a/bin/ksh/eval.c b/bin/ksh/eval.c
index e9e60e1dd10..37c42e676ea 100644
--- a/bin/ksh/eval.c
+++ b/bin/ksh/eval.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: eval.c,v 1.42 2015/09/17 14:21:33 nicm Exp $ */
+/* $OpenBSD: eval.c,v 1.43 2015/09/18 07:28:24 nicm Exp $ */
/*
* Expansion - quoting, separation, substitution, globbing
@@ -187,7 +187,7 @@ expand(char *cp, /* input word */
doblank = 0;
make_magic = 0;
word = (f&DOBLANK) ? IFS_WS : IFS_WORD;
- st_head.next = (SubType *) 0;
+ st_head.next = NULL;
st = &st_head;
while (1) {
@@ -294,7 +294,7 @@ expand(char *cp, /* input word */
newst = alloc(
sizeof(SubType), ATEMP);
- newst->next = (SubType *) 0;
+ newst->next = NULL;
newst->prev = st;
st->next = newst;
}
@@ -704,7 +704,7 @@ varsub(Expand *xp, char *sp, char *word,
if (sp[0] == '\0') /* Bad variable name */
return -1;
- xp->var = (struct tbl *) 0;
+ xp->var = NULL;
/* ${#var}, string length or array size */
if (sp[0] == '#' && (c = sp[1]) != '\0') {
@@ -871,7 +871,7 @@ comsub(Expand *xp, char *cp)
} else {
int ofd1, pv[2];
openpipe(pv);
- shf = shf_fdopen(pv[0], SHF_RD, (struct shf *) 0);
+ shf = shf_fdopen(pv[0], SHF_RD, NULL);
ofd1 = savefd(1);
if (pv[1] != 1) {
ksh_dup2(pv[1], 1, false);
diff --git a/bin/ksh/exec.c b/bin/ksh/exec.c
index e10cec2ce41..d8d1ef23c66 100644
--- a/bin/ksh/exec.c
+++ b/bin/ksh/exec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: exec.c,v 1.55 2015/09/17 14:21:33 nicm Exp $ */
+/* $OpenBSD: exec.c,v 1.56 2015/09/18 07:28:24 nicm Exp $ */
/*
* execute command tree
@@ -168,7 +168,7 @@ execute(struct op *volatile t,
e->type = E_ERRH;
i = sigsetjmp(e->jbuf, 0);
if (i) {
- sigprocmask(SIG_SETMASK, &omask, (sigset_t *) 0);
+ sigprocmask(SIG_SETMASK, &omask, NULL);
quitenv(NULL);
unwind(i);
/* NOTREACHED */
@@ -190,7 +190,7 @@ execute(struct op *volatile t,
close(pv[0]);
}
coproc.write = pv[1];
- coproc.job = (void *) 0;
+ coproc.job = NULL;
if (coproc.readw >= 0)
ksh_dup2(coproc.readw, 1, false);
@@ -203,7 +203,7 @@ execute(struct op *volatile t,
/* create new coprocess id */
++coproc.id;
}
- sigprocmask(SIG_SETMASK, &omask, (sigset_t *) 0);
+ sigprocmask(SIG_SETMASK, &omask, NULL);
e->type = E_EXEC; /* no more need for error handler */
/* exchild() closes coproc.* in child after fork,
@@ -548,7 +548,7 @@ comexec(struct op *t, struct tbl *volatile tp, char **ap, volatile int flags,
}
break;
}
- if (include(tp->u.fpath, 0, (char **) 0, 0) < 0) {
+ if (include(tp->u.fpath, 0, NULL, 0) < 0) {
warningf(true,
"%s: can't open function definition file %s - %s",
cp, tp->u.fpath, strerror(errno));
@@ -690,7 +690,7 @@ scriptexec(struct op *tp, char **ap)
shell = str_val(global(EXECSHELL_STR));
if (shell && *shell)
- shell = search(shell, path, X_OK, (int *) 0);
+ shell = search(shell, path, X_OK, NULL);
if (!shell || !*shell)
shell = EXECSHELL;
@@ -722,7 +722,7 @@ struct tbl *
findfunc(const char *name, unsigned int h, int create)
{
struct block *l;
- struct tbl *tp = (struct tbl *) 0;
+ struct tbl *tp = NULL;
for (l = e->loc; l; l = l->next) {
tp = ktsearch(&l->funs, name, h);
@@ -732,7 +732,7 @@ findfunc(const char *name, unsigned int h, int create)
tp = ktenter(&l->funs, name, h);
tp->flag = DEFINED;
tp->type = CFUNC;
- tp->val.t = (struct op *) 0;
+ tp->val.t = NULL;
break;
}
}
diff --git a/bin/ksh/expr.c b/bin/ksh/expr.c
index 4a8b7145e69..6d53c7882c9 100644
--- a/bin/ksh/expr.c
+++ b/bin/ksh/expr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: expr.c,v 1.26 2015/09/17 14:21:33 nicm Exp $ */
+/* $OpenBSD: expr.c,v 1.27 2015/09/18 07:28:24 nicm Exp $ */
/*
* Korn expression evaluation
@@ -174,8 +174,8 @@ v_evaluate(struct tbl *vp, const char *expr, volatile int error_ok,
curstate.expression = curstate.tokp = expr;
curstate.noassign = 0;
curstate.arith = arith;
- curstate.evaling = (struct tbl *) 0;
- curstate.val = (struct tbl *) 0;
+ curstate.evaling = NULL;
+ curstate.val = NULL;
newenv(E_ERRH);
i = sigsetjmp(e->jbuf, 0);
@@ -588,7 +588,7 @@ intvar(Expr_state *es, struct tbl *vp)
vp->flag |= EXPRINEVAL;
v_evaluate(vq, str_val(vp), KSH_UNWIND_ERROR, es->arith);
vp->flag &= ~EXPRINEVAL;
- es->evaling = (struct tbl *) 0;
+ es->evaling = NULL;
}
return vq;
}
diff --git a/bin/ksh/io.c b/bin/ksh/io.c
index 65c9e94faf2..613e5dc576a 100644
--- a/bin/ksh/io.c
+++ b/bin/ksh/io.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: io.c,v 1.28 2015/09/17 14:21:33 nicm Exp $ */
+/* $OpenBSD: io.c,v 1.29 2015/09/18 07:28:24 nicm Exp $ */
/*
* shell buffered IO and formatted output
@@ -424,12 +424,12 @@ maketemp(Area *ap, Temp_type type, struct temp **tlist)
len = strlen(dir) + 3 + 20 + 20 + 1;
tp = alloc(sizeof(struct temp) + len, ap);
tp->name = path = (char *) &tp[1];
- tp->shf = (struct shf *) 0;
+ tp->shf = NULL;
tp->type = type;
shf_snprintf(path, len, "%s/shXXXXXXXX", dir);
fd = mkstemp(path);
if (fd >= 0)
- tp->shf = shf_fdopen(fd, SHF_WR, (struct shf *) 0);
+ tp->shf = shf_fdopen(fd, SHF_WR, NULL);
tp->pid = procpid;
tp->next = *tlist;
diff --git a/bin/ksh/lex.c b/bin/ksh/lex.c
index 72ce95c81f4..262b318c683 100644
--- a/bin/ksh/lex.c
+++ b/bin/ksh/lex.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lex.c,v 1.53 2015/09/17 14:21:33 nicm Exp $ */
+/* $OpenBSD: lex.c,v 1.54 2015/09/18 07:28:24 nicm Exp $ */
/*
* lexical analysis and source input
@@ -1135,7 +1135,7 @@ getsc_line(Source *s)
#endif /* HISTORY */
}
if (interactive)
- set_prompt(PS2, (Source *) 0);
+ set_prompt(PS2, NULL);
}
static char *
diff --git a/bin/ksh/main.c b/bin/ksh/main.c
index 4c86593393a..63ec3324c67 100644
--- a/bin/ksh/main.c
+++ b/bin/ksh/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.59 2015/09/17 14:21:33 nicm Exp $ */
+/* $OpenBSD: main.c,v 1.60 2015/09/18 07:28:24 nicm Exp $ */
/*
* startup, main loop, environments and error handling
@@ -272,7 +272,7 @@ main(int argc, char *argv[])
/* this to note if monitor is set on command line (see below) */
Flag(FMONITOR) = 127;
- argi = parse_args(argv, OF_CMDLINE, (int *) 0);
+ argi = parse_args(argv, OF_CMDLINE, NULL);
if (argi < 0)
exit(1);
@@ -295,8 +295,7 @@ main(int argc, char *argv[])
Flag(FSTDIN) = 1;
s = pushs(SSTDIN, ATEMP);
s->file = "<stdin>";
- s->u.shf = shf_fdopen(0, SHF_RD | can_seek(0),
- (struct shf *) 0);
+ s->u.shf = shf_fdopen(0, SHF_RD | can_seek(0), NULL);
if (isatty(0) && isatty(2)) {
Flag(FTALKING) = Flag(FTALKING_I) = 1;
/* The following only if isatty(0) */
@@ -343,14 +342,13 @@ main(int argc, char *argv[])
warningf(false, "Cannot determine current working directory");
if (Flag(FLOGIN)) {
- include(KSH_SYSTEM_PROFILE, 0, (char **) 0, 1);
+ include(KSH_SYSTEM_PROFILE, 0, NULL, 1);
if (!Flag(FPRIVILEGED))
- include(substitute("$HOME/.profile", 0), 0,
- (char **) 0, 1);
+ include(substitute("$HOME/.profile", 0), 0, NULL, 1);
}
if (Flag(FPRIVILEGED))
- include("/etc/suid_profile", 0, (char **) 0, 1);
+ include("/etc/suid_profile", 0, NULL, 1);
else if (Flag(FTALKING)) {
char *env_file;
@@ -364,7 +362,7 @@ main(int argc, char *argv[])
#endif /* DEFAULT_ENV */
env_file = substitute(env_file, DOTILDE);
if (*env_file != '\0')
- include(env_file, 0, (char **) 0, 1);
+ include(env_file, 0, NULL, 1);
}
if (is_restricted(argv[0]) || is_restricted(str_val(global("SHELL"))))
@@ -423,7 +421,7 @@ include(const char *name, int argc, char **argv, int intr_ok)
old_argv = e->loc->argv;
old_argc = e->loc->argc;
} else {
- old_argv = (char **) 0;
+ old_argv = NULL;
old_argc = 0;
}
newenv(E_INCL);
@@ -729,10 +727,10 @@ cleanup_parents_env(void)
if (ep->savefd[fd] > 0)
close(ep->savefd[fd]);
afree(ep->savefd, &ep->area);
- ep->savefd = (short *) 0;
+ ep->savefd = NULL;
}
}
- e->oenv = (struct env *) 0;
+ e->oenv = NULL;
}
/* Called just before an execve cleanup stuff temporary files */
diff --git a/bin/ksh/misc.c b/bin/ksh/misc.c
index 7a38c99558c..efacd94ac1b 100644
--- a/bin/ksh/misc.c
+++ b/bin/ksh/misc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: misc.c,v 1.44 2015/09/17 14:21:33 nicm Exp $ */
+/* $OpenBSD: misc.c,v 1.45 2015/09/18 07:28:24 nicm Exp $ */
/*
* Miscellaneous functions
@@ -807,7 +807,7 @@ pat_scan(const unsigned char *p, const unsigned char *pe, int match_sep)
if ((*p & 0x80) && strchr("*+?@! ", *p & 0x7f))
nest++;
}
- return (const unsigned char *) 0;
+ return NULL;
}
/*
diff --git a/bin/ksh/shf.c b/bin/ksh/shf.c
index 6c4bbb2423a..a0b98ba2bca 100644
--- a/bin/ksh/shf.c
+++ b/bin/ksh/shf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: shf.c,v 1.21 2015/09/17 14:21:33 nicm Exp $ */
+/* $OpenBSD: shf.c,v 1.22 2015/09/18 07:28:24 nicm Exp $ */
/*
* Shell file I/O routines
@@ -99,7 +99,7 @@ shf_fdopen(int fd, int sflags, struct shf *shf)
shf->buf = alloc(bsize, ATEMP);
sflags |= SHF_ALLOCB;
} else
- shf->buf = (unsigned char *) 0;
+ shf->buf = NULL;
} else {
shf = alloc(sizeof(struct shf) + bsize, ATEMP);
shf->buf = (unsigned char *) &shf[1];
diff --git a/bin/ksh/syn.c b/bin/ksh/syn.c
index 544a1e8ba64..a8df1e9134d 100644
--- a/bin/ksh/syn.c
+++ b/bin/ksh/syn.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: syn.c,v 1.32 2015/09/17 14:21:33 nicm Exp $ */
+/* $OpenBSD: syn.c,v 1.33 2015/09/18 07:28:24 nicm Exp $ */
/*
* shell parser (C version)
@@ -356,7 +356,7 @@ get_command(int cf)
case BANG:
syniocf &= ~(KEYWORD|ALIAS);
t = pipeline(0);
- if (t == (struct op *) 0)
+ if (t == NULL)
syntaxerr(NULL);
t = block(TBANG, NOBLOCK, t, NOWORDS);
break;
@@ -557,7 +557,7 @@ function_body(char *name,
old_func_parse = e->flags & EF_FUNC_PARSE;
e->flags |= EF_FUNC_PARSE;
- if ((t->left = get_command(CONTIN)) == (struct op *) 0) {
+ if ((t->left = get_command(CONTIN)) == NULL) {
/*
* Probably something like foo() followed by eof or ;.
* This is accepted by sh and ksh88.
@@ -866,7 +866,7 @@ dbtestp_getopnd(Test_env *te, Test_op op, int do_eval)
int c = tpeek(ARRAYVAR);
if (c != LWORD)
- return (const char *) 0;
+ return NULL;
ACCEPT;
XPput(*te->pos.av, yylval.cp);
diff --git a/bin/ksh/table.c b/bin/ksh/table.c
index 07192f68f17..cb27bbf5ffe 100644
--- a/bin/ksh/table.c
+++ b/bin/ksh/table.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: table.c,v 1.17 2015/09/17 14:21:33 nicm Exp $ */
+/* $OpenBSD: table.c,v 1.18 2015/09/18 07:28:24 nicm Exp $ */
/*
* dynamic hashed associative table for commands and variables
@@ -123,7 +123,7 @@ ktenter(struct table *tp, const char *n, unsigned int h)
p->type = 0;
p->areap = tp->areap;
p->u2.field = 0;
- p->u.array = (struct tbl *)0;
+ p->u.array = NULL;
memcpy(p->name, n, len);
/* enter in tp->tbls */
diff --git a/bin/ksh/trap.c b/bin/ksh/trap.c
index f84aa712809..a3c94aea73d 100644
--- a/bin/ksh/trap.c
+++ b/bin/ksh/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.24 2015/09/15 18:15:05 tedu Exp $ */
+/* $OpenBSD: trap.c,v 1.25 2015/09/18 07:28:24 nicm Exp $ */
/*
* signal handling
@@ -387,7 +387,7 @@ setsig(Trap *p, sig_t f, int flags)
sigemptyset(&sigact.sa_mask);
sigact.sa_flags = 0 /* interruptible */;
sigact.sa_handler = f;
- sigaction(p->signal, &sigact, (struct sigaction *) 0);
+ sigaction(p->signal, &sigact, NULL);
}
return 1;
diff --git a/bin/ksh/var.c b/bin/ksh/var.c
index c23a3130af5..a35c9d96873 100644
--- a/bin/ksh/var.c
+++ b/bin/ksh/var.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: var.c,v 1.48 2015/09/17 14:21:33 nicm Exp $ */
+/* $OpenBSD: var.c,v 1.49 2015/09/18 07:28:24 nicm Exp $ */
#include "sh.h"
#include <time.h>
@@ -257,7 +257,7 @@ local(const char *n, bool copy)
vp = ktenter(&l->vars, n, h);
if (copy && !(vp->flag & DEFINED)) {
struct block *ll = l;
- struct tbl *vq = (struct tbl *) 0;
+ struct tbl *vq = NULL;
while ((ll = ll->next) && !(vq = ktsearch(&ll->vars, n, h)))
;
@@ -746,7 +746,7 @@ unset(struct tbl *vp, int array_ref)
afree(tmp->val.s, tmp->areap);
afree(tmp, tmp->areap);
}
- vp->u.array = (struct tbl *) 0;
+ vp->u.array = NULL;
}
/* If foo[0] is being unset, the remainder of the array is kept... */
vp->flag &= SPECIAL | (array_ref ? ARRAY|DEFINED : 0);
diff --git a/bin/ksh/vi.c b/bin/ksh/vi.c
index c24fd043fdb..6888204c212 100644
--- a/bin/ksh/vi.c
+++ b/bin/ksh/vi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vi.c,v 1.32 2015/09/17 14:21:33 nicm Exp $ */
+/* $OpenBSD: vi.c,v 1.33 2015/09/18 07:28:24 nicm Exp $ */
/*
* vi command editing
@@ -1915,7 +1915,7 @@ expand_word(int command)
nwords = x_cf_glob(XCF_COMMAND_FILE|XCF_FULLPATH,
es->cbuf, es->linelen, es->cursor,
- &start, &end, &words, (int *) 0);
+ &start, &end, &words, NULL);
if (nwords == 0) {
vi_error();
return -1;