From e252984993fdfd57a1fdc1eaf393e42e8589d623 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Wed, 5 Jun 2019 06:44:08 +0100 Subject: If only one of -x or -y is given, use the calculated size for the other. Also fix some warnings. Pointed out by Ben Boeckel. --- format.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'format.c') diff --git a/format.c b/format.c index 45479d5e..5ca970b7 100644 --- a/format.c +++ b/format.c @@ -1518,7 +1518,7 @@ format_replace(struct format_tree *ft, const char *key, size_t keylen, char **buf, size_t *len, size_t *off) { struct window_pane *wp = ft->wp; - const char *errptr, *copy, *cp, *marker; + const char *errptr, *copy, *cp, *marker = NULL; char *copy0, *condition, *found, *new; char *value, *left, *right; size_t valuelen; @@ -1566,8 +1566,6 @@ format_replace(struct format_tree *ft, const char *key, size_t keylen, limit = 0; if (fm->argc == 2 && fm->argv[1] != NULL) marker = fm->argv[1]; - else - marker = NULL; break; case 'l': modifiers |= FORMAT_LITERAL; -- cgit