diff options
author | Burt P <pburt0@gmail.com> | 2019-08-18 16:05:20 -0500 |
---|---|---|
committer | Leandro A. F. Pereira <leandro@hardinfo.org> | 2019-08-18 23:49:29 +0200 |
commit | d285b2f6209e6ced22482d15e3a78e67731e8bf7 (patch) | |
tree | 53de0d87f2228347114ca6d4e8a838f5fa8e3e48 /hardinfo/x_util.c | |
parent | e468a3b02dd5dac177b5ae0b611cfe95393a60d1 (diff) |
x_util: lpereira's patch
https://github.com/lpereira/hardinfo/pull/449#issuecomment-522354180
Diffstat (limited to 'hardinfo/x_util.c')
-rw-r--r-- | hardinfo/x_util.c | 8 |
1 files 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: * <output_id> (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); |