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
6
lrzip.c
6
lrzip.c
|
|
@ -1280,9 +1280,9 @@ bool initialise_control(rzip_control *control)
|
||||||
if (control->tmpdir == NULL)
|
if (control->tmpdir == NULL)
|
||||||
fatal_return(("Failed to allocate for tmpdir\n"), false);
|
fatal_return(("Failed to allocate for tmpdir\n"), false);
|
||||||
strcpy(control->tmpdir, eptr);
|
strcpy(control->tmpdir, eptr);
|
||||||
if (control->tmpdir[len] != '/')
|
if (control->tmpdir[len-1] != '/') {
|
||||||
control->tmpdir[len] = '/'; /* need a trailing slash */
|
control->tmpdir[len] = '/'; /* need a trailing slash */
|
||||||
control->tmpdir[len+1] = '\0';
|
control->tmpdir[len+1] = '\0';
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue