mirror of
https://github.com/jarun/nnn.git
synced 2025-01-15 13:26:37 +00:00
fix incorrect usage of sizeof
`sizeof(cmd)` here would give the sizeof a char pointer, not the sizeof the cp/mv array.
This commit is contained in:
parent
01ab453cff
commit
5ae3891ee5
|
@ -2542,7 +2542,7 @@ static bool cpmv_rename(int choice, const char *path)
|
|||
uint_t count = 0, lines = 0;
|
||||
bool ret = FALSE;
|
||||
char *cmd = (choice == 'c' ? cp : mv);
|
||||
char buf[sizeof(patterns[P_CPMVRNM]) + sizeof(cmd) + (PATH_MAX << 1)];
|
||||
char buf[sizeof(patterns[P_CPMVRNM]) + (MAX(sizeof(cp), sizeof(mv))) + (PATH_MAX << 1)];
|
||||
|
||||
fd = create_tmp_file();
|
||||
if (fd == -1)
|
||||
|
|
Loading…
Reference in a new issue