summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu.herrb@laas.fr>2008-06-13 12:23:03 -0600
committerMatthieu Herrb <matthieu@bluenote.herrb.net>2008-06-13 12:27:16 -0600
commit0fbda267334eb531b7153c3b9035fe7470302e13 (patch)
treecd71edbd6f968cccd042833fea312c4dc558d379
parent53743925d1067b830dd80f9193444f5799f55e28 (diff)
Don't print '(null)' when XF86VidModeGetMonitor() returns NULL fields.
-rw-r--r--xdpyinfo.c4
1 files changed, 3 insertions, 1 deletions
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,