From 0fbda267334eb531b7153c3b9035fe7470302e13 Mon Sep 17 00:00:00 2001 From: Matthieu Herrb Date: Fri, 13 Jun 2008 12:23:03 -0600 Subject: [PATCH] Don't print '(null)' when XF86VidModeGetMonitor() returns NULL fields. --- xdpyinfo.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xdpyinfo.c b/xdpyinfo.c index 0a4ff63..e9717b3 100644 --- a/xdpyinfo.c +++ b/xdpyinfo.c @@ -778,7 +778,9 @@ print_XF86VidMode_info(Display *dpy, char *extname) if (!XF86VidModeGetMonitor(dpy, DefaultScreen(dpy), &monitor)) return 0; printf(" Monitor Information:\n"); - printf(" Vendor: %s, Model: %s\n", monitor.vendor, monitor.model); + printf(" Vendor: %s, Model: %s\n", + monitor.vendor == NULL ? "" : monitor.vendor, + monitor.model == NULL ? "" : monitor.model); printf(" Num hsync: %d, Num vsync: %d\n", monitor.nhsync, monitor.nvsync); for (i = 0; i < monitor.nhsync; i++) { printf(" hsync range %d: %6.2f - %6.2f\n", i, monitor.hsync[i].lo, -- 2.7.4