Skip to content

Commit 1cf6580

Browse files
committed
Fix issue sysstat#48 for good: sar skips long filesystem names
How the number of filesystems is counted should be consistent with commit a82d6ab. Signed-off-by: Sebastien GODARD <[email protected]>
1 parent a82d6ab commit 1cf6580

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

count.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ int get_usb_nr(void)
461461
int get_filesystem_nr(void)
462462
{
463463
FILE *fp;
464-
char line[256], fs_name[MAX_FS_LEN], mountp[128];
464+
char line[512], fs_name[MAX_FS_LEN], mountp[256];
465465
int fs = 0;
466466
struct statvfs buf;
467467

@@ -474,7 +474,8 @@ int get_filesystem_nr(void)
474474
if (line[0] == '/') {
475475

476476
/* Read filesystem name and mount point */
477-
sscanf(line, "%71s %127s", fs_name, mountp);
477+
sscanf(line, "%127s", fs_name);
478+
sscanf(strchr(line, ' ') + 1, "%255s", mountp);
478479

479480
/* Replace octal codes */
480481
oct2chr(mountp);

0 commit comments

Comments
 (0)