summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2003-12-18 17:15:38 +0000
committerJim Meyering <jim@meyering.net>2003-12-18 17:15:38 +0000
commit513aae0e6a10a23c63b3ebc23530741123ca6949 (patch)
tree0bd298515e3beef8e2cf7c1a5ac25c46ed84e3db /src
parent4679a731924614041c28e4bdc2712b1d3e859ec8 (diff)
downloadcoreutils-513aae0e6a10a23c63b3ebc23530741123ca6949.tar.xz
(format_user): Increment dired_pos via two statements,
`dired_pos += width; dired_pos++;' rather than one, `dired_pos += width + 1;' since the latter could conceivably overflow. (format_group): Likewise.
Diffstat (limited to 'src')
-rw-r--r--src/ls.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/ls.c b/src/ls.c
index 8126b8c60..6f8bc3380 100644
--- a/src/ls.c
+++ b/src/ls.c
@@ -2982,7 +2982,8 @@ format_user (uid_t u, int width)
printf ("%-*s ", width, name);
else
printf ("%*lu ", width, (unsigned long int) u);
- dired_pos += width + 1;
+ dired_pos += width;
+ dired_pos++;
}
/* Likewise, for groups. */
@@ -2995,7 +2996,8 @@ format_group (gid_t g, int width)
printf ("%-*s ", width, name);
else
printf ("%*lu ", width, (unsigned long int) g);
- dired_pos += width + 1;
+ dired_pos += width;
+ dired_pos++;
}
/* Return the number of bytes that format_user will print. */