From: Jim Meyering Date: Thu, 18 Dec 2003 17:15:38 +0000 (+0000) Subject: (format_user): Increment dired_pos via two statements, X-Git-Tag: v5.1.0~50 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=513aae0e6a10a23c63b3ebc23530741123ca6949;p=thirdparty%2Fcoreutils.git (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. --- diff --git a/src/ls.c b/src/ls.c index 8126b8c60d..6f8bc33801 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. */