]> tinc-vpn.org Git - tinc/blobdiff - src/top.c
Add field widths to sscanf() calls.
[tinc] / src / top.c
index 2824261c2a2a94e5de48d3ce67ef8a623d9b93ac..e517b4f906a95617e0fbd6936b8443b7a92ab04f 100644 (file)
--- a/src/top.c
+++ b/src/top.c
@@ -21,6 +21,7 @@
 
 #ifdef HAVE_CURSES
 
+#undef KEY_EVENT  /* There are conflicting declarations for KEY_EVENT in Windows wincon.h and curses.h. */
 #include <curses.h>
 
 #include "control_common.h"
@@ -89,7 +90,7 @@ static bool update(int fd) {
                ns->known = false;
 
        while(recvline(fd, line, sizeof line)) {
-               int n = sscanf(line, "%d %d %s %"PRIu64" %"PRIu64" %"PRIu64" %"PRIu64, &code, &req, name, &in_packets, &in_bytes, &out_packets, &out_bytes);
+               int n = sscanf(line, "%d %d %4095s %"PRIu64" %"PRIu64" %"PRIu64" %"PRIu64, &code, &req, name, &in_packets, &in_bytes, &out_packets, &out_bytes);
 
                if(n == 2)
                        return true;