Skip to content

Commit

Permalink
Fix issue #48 for good: sar skips long filesystem names
Browse files Browse the repository at this point in the history
How the number of filesystems is counted should be consistent with
commit a82d6ab.

Signed-off-by: Sebastien GODARD <[email protected]>
  • Loading branch information
sysstat committed Mar 24, 2015
1 parent a82d6ab commit 1cf6580
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions count.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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);
Expand Down

0 comments on commit 1cf6580

Please sign in to comment.