1
1

Fixup of formatted output of file size in 'File exists' dialog window.

The %j modifier used to show file size produces segmentation fault
on some platforms. PRIuMAX macro cannot be used within i18b'd strings.
Solution: use %llu modifier with typecasting to unsigned long long.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Этот коммит содержится в:
Andrew Borodin 2010-12-03 13:28:03 +03:00
родитель 2ac5f2ce18
Коммит 00b1aa4a8e

Просмотреть файл

@ -308,10 +308,10 @@ overwrite_query_dialog (FileOpContext * ctx, enum OperationMode mode)
{ N_("Target file already exists!"), 3, 4, 0 }, { N_("Target file already exists!"), 3, 4, 0 },
/* 1 */ /* 1 */
{ "%s", 4, 4, 0 }, { "%s", 4, 4, 0 },
/* 2 */ /* 2 */ /* cannot use PRIuMAX here; %llu is used instead */
{ N_("Source date: %s, size %ju"), 6, 4, 0 }, { N_("Source date: %s, size %llu"), 6, 4, 0 },
/* 3 */ /* 3 */ /* cannot use PRIuMAX here; %llu is used instead */
{ N_("Target date: %s, size %ju"), 7, 4, 0 }, { N_("Target date: %s, size %llu"), 7, 4, 0 },
/* 4 */ /* 4 */
{ N_("&Abort"), 14, 25, REPLACE_ABORT }, { N_("&Abort"), 14, 25, REPLACE_ABORT },
/* 5 */ /* 5 */
@ -429,9 +429,9 @@ overwrite_query_dialog (FileOpContext * ctx, enum OperationMode mode)
label_new (rd_widgets[1].ypos, (rd_xlen - stripped_name_len) / 2, stripped_name)); label_new (rd_widgets[1].ypos, (rd_xlen - stripped_name_len) / 2, stripped_name));
/* source date and size */ /* source date and size */
ADD_RD_LABEL (2, file_date (ui->s_stat->st_mtime), (uintmax_t) ui->s_stat->st_size); ADD_RD_LABEL (2, file_date (ui->s_stat->st_mtime), (unsigned long long) ui->s_stat->st_size);
/* destination date and size */ /* destination date and size */
ADD_RD_LABEL (3, file_date (ui->d_stat->st_mtime), (uintmax_t) ui->d_stat->st_size); ADD_RD_LABEL (3, file_date (ui->d_stat->st_mtime), (unsigned long long) ui->d_stat->st_size);
ADD_RD_BUTTON (4); /* Abort */ ADD_RD_BUTTON (4); /* Abort */
ADD_RD_BUTTON (5); /* If size differs */ ADD_RD_BUTTON (5); /* If size differs */