From 513aae0e6a10a23c63b3ebc23530741123ca6949 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Thu, 18 Dec 2003 17:15:38 +0000 Subject: (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. --- src/ls.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') 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. */ -- cgit v1.2.3-54-g00ecf