summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2019-04-24 20:27:52 +0000
committernicm <nicm@openbsd.org>2019-04-24 20:27:52 +0000
commit770b648cf836a86277b361583de64cedfe32a9d1 (patch)
treeb6b4478098773579697fdf6cd0c4bac23ec7cc18
parentDo not check for working go executable during make clean cleandir obj. (diff)
downloadwireguard-openbsd-770b648cf836a86277b361583de64cedfe32a9d1.tar.xz
wireguard-openbsd-770b648cf836a86277b361583de64cedfe32a9d1.zip
Do not loop forever if there is a nonprintable character in the format.
-rw-r--r--usr.bin/tmux/format-draw.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.bin/tmux/format-draw.c b/usr.bin/tmux/format-draw.c
index 8ffea3ec6c9..fe0240a3ca2 100644
--- a/usr.bin/tmux/format-draw.c
+++ b/usr.bin/tmux/format-draw.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: format-draw.c,v 1.7 2019/03/28 22:18:46 nicm Exp $ */
+/* $OpenBSD: format-draw.c,v 1.8 2019/04/24 20:27:52 nicm Exp $ */
/*
* Copyright (c) 2019 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -837,7 +837,8 @@ format_trim_left(const char *expanded, u_int limit)
*out++ = *cp;
width++;
cp++;
- }
+ } else
+ cp++;
}
*out = '\0';
return (copy);
@@ -883,7 +884,8 @@ format_trim_right(const char *expanded, u_int limit)
*out++ = *cp;
width++;
cp++;
- }
+ } else
+ cp++;
}
*out = '\0';
return (copy);