From ae986902cfc1846881bb4341f33c0e14b495c309 Mon Sep 17 00:00:00 2001 From: okan Date: Wed, 22 Jan 2020 19:58:35 +0000 Subject: add, then use, xvasprintf, checking for appropriate return. --- screen.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'screen.c') diff --git a/screen.c b/screen.c index f86394f..390dfe4 100644 --- a/screen.c +++ b/screen.c @@ -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 @@ -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); -- cgit v1.2.3-2-gb3c3