mirror of
https://github.com/ckolivas/lrzip.git
synced 2025-12-06 07:12:00 +01:00
Correct adding slash to control->tmpdir. off-by-one error.
This commit is contained in:
parent
7caef3ef85
commit
4a24a6dd10
4
lrzip.c
4
lrzip.c
|
|
@ -1280,9 +1280,9 @@ bool initialise_control(rzip_control *control)
|
|||
if (control->tmpdir == NULL)
|
||||
fatal_return(("Failed to allocate for tmpdir\n"), false);
|
||||
strcpy(control->tmpdir, eptr);
|
||||
if (control->tmpdir[len] != '/')
|
||||
if (control->tmpdir[len-1] != '/') {
|
||||
control->tmpdir[len] = '/'; /* need a trailing slash */
|
||||
control->tmpdir[len+1] = '\0';
|
||||
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue