aboutsummaryrefslogtreecommitdiffstats
path: root/screen.c
diff options
context:
space:
mode:
authorokan2020-01-22 19:58:35 +0000
committerWynn Wolf Arbor2020-03-18 14:28:38 +0100
commitae986902cfc1846881bb4341f33c0e14b495c309 (patch)
treeca4e99c73a46dcd34d3dc8afb6418ac2b2b8b562 /screen.c
parent178643ac5ef7fc3d2dbf28352edb566daefee288 (diff)
downloadcwm-ae986902cfc1846881bb4341f33c0e14b495c309.tar.gz
add, then use, xvasprintf, checking for appropriate return.
Diffstat (limited to 'screen.c')
-rw-r--r--screen.c7
1 files changed, 2 insertions, 5 deletions
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 <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);