From 03c82c22e30367e0a4aa9b18d8987b05ba5f0cd7 Mon Sep 17 00:00:00 2001 From: Nikos Tsipinakis Date: Sun, 2 Apr 2017 19:24:43 +0300 Subject: [PATCH] Fix uninitialized class name in dpi handling Make the class in the XrmGetResource call be the same as the resource name we are trying to retrieve, "Xft.dpi". Nowhere in the documentation it is mentioned that the class name can be NULL so it is better to be cautious and set it to a value that is unlikely to affect anything. --- src/x11/screen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/x11/screen.c b/src/x11/screen.c index 49abb82..3b197a8 100644 --- a/src/x11/screen.c +++ b/src/x11/screen.c @@ -49,7 +49,7 @@ static double get_xft_dpi_value() char *xrmType; XrmValue xrmValue; - if (XrmGetResource(xDB, "Xft.dpi", NULL, &xrmType, &xrmValue)) { + if (XrmGetResource(xDB, "Xft.dpi", "Xft.dpi", &xrmType, &xrmValue)) { dpi = strtod(xrmValue.addr, NULL); } else { dpi = 0;