Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/filemanager/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -2619,7 +2619,7 @@ copy_file_file (file_op_context_t *ctx, const char *src_path, const char *dst_pa
else if (ctx->do_append)
#ifdef HAVE_FILE_CLONING_BY_RANGE
// FICLONERANGE on Linux and copy_file_range(2) on FreeBSD support block-aligned ranges for
// cloning, but for not in O_APPEND mode. Use O_WRONLY + mc_lseek instead as we don't care
// cloning, but not in O_APPEND mode. Use O_WRONLY + mc_lseek instead as we don't care
// about atomicity in our use cases.
open_flags |= mc_global.vfs.file_cloning ? 0 : O_APPEND;
#else
Expand Down Expand Up @@ -3671,7 +3671,7 @@ panel_operate (void *source_panel, FileOperation operation, gboolean force_singl
break;

if (ctx->ignore_all
|| file_error (ctx, TRUE, _ ("Destination\n%s\nmust be a directory\n%s"), dest)
|| file_error (ctx, TRUE, _ ("Destination\n%s\nmust be a directory"), dest)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inside file_error, an empty string is passed as a second format argument, but my understanding is that it is harmless to remove the format descriptor, even though it's a somewhat questionable design.

Online C Draft Standard (n1256), s. 7.19.6.1, p. 2:

The fprintf function writes output to the stream pointed to by stream, under control of the string pointed to by format that specifies how subsequent arguments are converted for output. If there are insufficient arguments for the format, the behavior is undefined. If the format is exhausted while arguments remain, the excess arguments are evaluated (as always) but are otherwise ignored. The fprintf function returns when the end of the format string is encountered.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure it's not a bug but seems to be unintentional leftover and looks misleading.

!= FILE_RETRY)
goto clean_up;
}
Expand Down
Loading