]> granicus.if.org Git - sysstat/commitdiff
Fix issue #48 for good: sar skips long filesystem names
authorSebastien GODARD <sysstat@users.noreply.github.com>
Tue, 24 Mar 2015 20:38:07 +0000 (21:38 +0100)
committerSebastien GODARD <sysstat@users.noreply.github.com>
Tue, 24 Mar 2015 20:38:07 +0000 (21:38 +0100)
How the number of filesystems is counted should be consistent with
commit a82d6ab.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
count.c

diff --git a/count.c b/count.c
index ceca3f5a1336430ecd418f9e66002ff133d03db9..da1f336b9412a6984f1894bd22660155b47153db 100644 (file)
--- a/count.c
+++ b/count.c
@@ -461,7 +461,7 @@ int get_usb_nr(void)
 int get_filesystem_nr(void)
 {
        FILE *fp;
-       char line[256], fs_name[MAX_FS_LEN], mountp[128];
+       char line[512], fs_name[MAX_FS_LEN], mountp[256];
        int fs = 0;
        struct statvfs buf;
 
@@ -474,7 +474,8 @@ int get_filesystem_nr(void)
                if (line[0] == '/') {
 
                        /* Read filesystem name and mount point */
-                       sscanf(line, "%71s %127s", fs_name, mountp);
+                       sscanf(line, "%127s", fs_name);
+                       sscanf(strchr(line, ' ') + 1, "%255s", mountp);
 
                        /* Replace octal codes */
                        oct2chr(mountp);