diff options
author | okan | 2020-01-22 19:58:35 +0000 |
---|---|---|
committer | Wynn Wolf Arbor | 2020-03-18 14:28:38 +0100 |
commit | ae986902cfc1846881bb4341f33c0e14b495c309 (patch) | |
tree | ca4e99c73a46dcd34d3dc8afb6418ac2b2b8b562 /screen.c | |
parent | 178643ac5ef7fc3d2dbf28352edb566daefee288 (diff) | |
download | cwm-ae986902cfc1846881bb4341f33c0e14b495c309.tar.gz |
add, then use, xvasprintf, checking for appropriate return.
Diffstat (limited to '')
-rw-r--r-- | screen.c | 7 |
1 files changed, 2 insertions, 5 deletions
@@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: screen.c,v 1.93 2019/03/08 20:33:30 okan Exp $ + * $OpenBSD: screen.c,v 1.94 2020/01/22 19:58:35 okan Exp $ */ #include <sys/types.h> @@ -275,15 +275,12 @@ void screen_prop_win_draw(struct screen_ctx *sc, const char *fmt, ...) { va_list ap; - int i; char *text; XGlyphInfo extents; va_start(ap, fmt); - i = vasprintf(&text, fmt, ap); + xvasprintf(&text, fmt, ap); va_end(ap); - if (i < 0 || text == NULL) - err(1, "vasprintf"); XftTextExtentsUtf8(X_Dpy, sc->xftfont, (const FcChar8*)text, strlen(text), &extents); |