for each byte of output generated by this program so that the beginning
and ending indices (in that output) of every file name can be recorded
and later output themselves. */
-static size_t dired_pos;
+static off_t dired_pos;
static void
dired_outbyte (char c)
n_pos = obstack_object_size (os) / sizeof (dired_pos);
if (n_pos > 0)
{
- size_t *pos = (size_t *) obstack_finish (os);
+ off_t *pos = obstack_finish (os);
fputs (prefix, stdout);
for (size_t i = 0; i < n_pos; i++)
- printf (" %lu", (unsigned long int) pos[i]);
+ {
+ intmax_t p = pos[i];
+ printf (" %"PRIdMAX, p);
+ }
putchar ('\n');
}
}
print width of WIDTH columns. */
static void
-format_user_or_group (char const *name, unsigned long int id, int width)
+format_user_or_group (char const *name, uintmax_t id, int width)
{
if (name)
{
while (pad--);
}
else
- dired_pos += printf ("%*lu ", width, id);
+ dired_pos += printf ("%*"PRIuMAX" ", width, id);
}
/* Print the name or id of the user with id U, using a print width of
/* Return the number of columns that format_user_or_group will print. */
static int
-format_user_or_group_width (char const *name, unsigned long int id)
+format_user_or_group_width (char const *name, uintmax_t id)
{
if (name)
{
return MAX (0, len);
}
else
- {
- char buf[INT_BUFSIZE_BOUND (id)];
- return sprintf (buf, "%lu", id);
- }
+ return snprintf (NULL, 0, "%"PRIuMAX, id);
}
/* Return the number of columns that format_user will print. */