Ensure lstat program puts a space between fields, even with very large inode numbers
authorfsgqa <fsgqa>
Fri, 5 Sep 2003 06:43:17 +0000 (06:43 +0000)
committerfsgqa <fsgqa>
Fri, 5 Sep 2003 06:43:17 +0000 (06:43 +0000)
src/lstat64.c

index e79292c74b7b979cf192d0b50697370da7ddc9a0..5eb306e82c7ac8be34ffb35f6ab4507806513bf8 100644 (file)
@@ -64,7 +64,7 @@ main(int argc, char **argv)
 {
        struct stat64   sbuf;
        char            mode[10];
-       int             i;
+       int             i, c;
 
        time(&timebuf);
 
@@ -144,7 +144,9 @@ main(int argc, char **argv)
                printf("  Gid: (%d)\n", sbuf.st_gid);
                printf("Device: %2d,%-2d", major(sbuf.st_dev),
                                minor(sbuf.st_dev));
-               printf("  Inode: %-10llu", (unsigned long long)sbuf.st_ino);
+               c = printf("  Inode: %-10llu", (unsigned long long)sbuf.st_ino);
+               if (c >= 10)
+                       putchar(' ');
                printf("Links: %-5d", sbuf.st_nlink);
 
                if ( ((sbuf.st_mode & S_IFMT) == S_IFCHR)