diff options
author | Jim Meyering <jim@meyering.net> | 2003-12-18 17:15:38 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2003-12-18 17:15:38 +0000 |
commit | 513aae0e6a10a23c63b3ebc23530741123ca6949 (patch) | |
tree | 0bd298515e3beef8e2cf7c1a5ac25c46ed84e3db /src | |
parent | 4679a731924614041c28e4bdc2712b1d3e859ec8 (diff) | |
download | coreutils-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.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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. */ |