diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2019-04-25 19:37:00 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2019-04-25 19:37:00 +0000 |
commit | 83d0562ddfd20cee3ae28eda48eb1753f9b84abf (patch) | |
tree | d7124bad8aae9021cba0a9b3cdd22b5492361d06 | |
parent | 264aa85995159ad9250c3a7e673cd7176348de2a (diff) |
options_array_item_value cannot return NULL.
-rw-r--r-- | usr.bin/tmux/cmd.c | 6 | ||||
-rw-r--r-- | usr.bin/tmux/environ.c | 6 | ||||
-rw-r--r-- | usr.bin/tmux/status.c | 9 | ||||
-rw-r--r-- | usr.bin/tmux/tty-keys.c | 5 | ||||
-rw-r--r-- | usr.bin/tmux/tty-term.c | 5 |
5 files changed, 8 insertions, 23 deletions
diff --git a/usr.bin/tmux/cmd.c b/usr.bin/tmux/cmd.c index 15ca4f0ca27..335279c5aa9 100644 --- a/usr.bin/tmux/cmd.c +++ b/usr.bin/tmux/cmd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd.c,v 1.143 2019/04/23 20:36:55 nicm Exp $ */ +/* $OpenBSD: cmd.c,v 1.144 2019/04/25 19:36:59 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -335,10 +335,6 @@ cmd_try_alias(int *argc, char ***argv) a = options_array_first(o); while (a != NULL) { ov = options_array_item_value(a); - if (ov == NULL) { - a = options_array_next(a); - continue; - } cp = strchr(ov->string, '='); if (cp != NULL && (size_t)(cp - ov->string) == wanted && diff --git a/usr.bin/tmux/environ.c b/usr.bin/tmux/environ.c index d248ef0b966..6c45a205067 100644 --- a/usr.bin/tmux/environ.c +++ b/usr.bin/tmux/environ.c @@ -1,4 +1,4 @@ -/* $OpenBSD: environ.c,v 1.22 2019/04/23 20:36:55 nicm Exp $ */ +/* $OpenBSD: environ.c,v 1.23 2019/04/25 19:36:59 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -185,10 +185,6 @@ environ_update(struct options *oo, struct environ *src, struct environ *dst) a = options_array_first(o); while (a != NULL) { ov = options_array_item_value(a); - if (ov == NULL) { - a = options_array_next(a); - continue; - } if ((envent = environ_find(src, ov->string)) == NULL) environ_clear(dst, ov->string); else diff --git a/usr.bin/tmux/status.c b/usr.bin/tmux/status.c index 958ac0eddc2..ae18fa630f1 100644 --- a/usr.bin/tmux/status.c +++ b/usr.bin/tmux/status.c @@ -1,4 +1,4 @@ -/* $OpenBSD: status.c,v 1.194 2019/04/23 20:40:03 nicm Exp $ */ +/* $OpenBSD: status.c,v 1.195 2019/04/25 19:36:59 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -1293,7 +1293,6 @@ status_prompt_complete_list(u_int *size, const char *s) size_t slen = strlen(s), valuelen; struct options_entry *o; struct options_array_item *a; - union options_value *ov; const char *layouts[] = { "even-horizontal", "even-vertical", "main-horizontal", "main-vertical", "tiled", NULL @@ -1322,11 +1321,7 @@ status_prompt_complete_list(u_int *size, const char *s) if (o != NULL) { a = options_array_first(o); while (a != NULL) { - ov = options_array_item_value(a); - if (ov == NULL) - goto next; - - value = ov->string; + value = options_array_item_value(a)->string; if ((cp = strchr(value, '=')) == NULL) goto next; valuelen = cp - value; diff --git a/usr.bin/tmux/tty-keys.c b/usr.bin/tmux/tty-keys.c index 00d11350b43..e7bb79471f1 100644 --- a/usr.bin/tmux/tty-keys.c +++ b/usr.bin/tmux/tty-keys.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty-keys.c,v 1.109 2019/04/23 20:40:03 nicm Exp $ */ +/* $OpenBSD: tty-keys.c,v 1.110 2019/04/25 19:36:59 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -429,8 +429,7 @@ tty_keys_build(struct tty *tty) a = options_array_first(o); while (a != NULL) { ov = options_array_item_value(a); - if (ov != NULL) - tty_keys_add(tty, ov->string, KEYC_USER + i); + tty_keys_add(tty, ov->string, KEYC_USER + i); a = options_array_next(a); } } diff --git a/usr.bin/tmux/tty-term.c b/usr.bin/tmux/tty-term.c index 5b63d58105d..e3db804c190 100644 --- a/usr.bin/tmux/tty-term.c +++ b/usr.bin/tmux/tty-term.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty-term.c,v 1.62 2019/04/23 20:36:55 nicm Exp $ */ +/* $OpenBSD: tty-term.c,v 1.63 2019/04/25 19:36:59 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -496,8 +496,7 @@ tty_term_find(char *name, int fd, char **cause) a = options_array_first(o); while (a != NULL) { ov = options_array_item_value(a); - if (ov != NULL) - tty_term_override(term, ov->string); + tty_term_override(term, ov->string); a = options_array_next(a); } |