From d285b2f6209e6ced22482d15e3a78e67731e8bf7 Mon Sep 17 00:00:00 2001 From: Burt P Date: Sun, 18 Aug 2019 16:05:20 -0500 Subject: x_util: lpereira's patch https://github.com/lpereira/hardinfo/pull/449#issuecomment-522354180 --- hardinfo/x_util.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hardinfo/x_util.c b/hardinfo/x_util.c index 07d5226a..1508f525 100644 --- a/hardinfo/x_util.c +++ b/hardinfo/x_util.c @@ -162,9 +162,9 @@ gboolean fill_xrr_info(xrr_info *xrr) { memset(&ts, 0, sizeof(x_screen)); memset(&to, 0, sizeof(x_output)); - memset(output_id, 0, 128); - memset(status, 0, 128); - memset(alist, 0, 128); + memset(output_id, 0, sizeof(output_id)); + memset(status, 0, sizeof(status)); + memset(alist, 0, sizeof(alist)); spawned = hardinfo_spawn_command_line_sync(xrr_cmd, &out, &err, NULL, NULL); @@ -195,7 +195,7 @@ gboolean fill_xrr_info(xrr_info *xrr) { /* looking for: * (connected|disconnected|unknown connection) (primary|?) <%dx%d+%d+%d> (attribute_list) mm x mm */ - ec = sscanf(p, "%s %[^(](%[^)]", output_id, status, alist); + ec = sscanf(p, "%127s %127[^(](%511[^)]", output_id, status, alist); if (ec == 3) { int is_output = 0, found_rect = 0, n = 0; gchar **ot = g_strsplit(status, " ", 0); -- cgit v1.2.3