mirror of
https://github.com/transmission/transmission
synced 2025-01-31 03:12:44 +00:00
tr_ctorSetDownloadDir(): handle NULL download dirs more gracefully.
This commit is contained in:
parent
9c649d7752
commit
a029f4e34a
1 changed files with 7 additions and 2 deletions
|
@ -207,8 +207,13 @@ tr_ctorSetDownloadDir( tr_ctor * ctor,
|
|||
const char * directory )
|
||||
{
|
||||
struct optional_args * args = &ctor->optionalArgs[mode];
|
||||
if( directory ) {
|
||||
args->isSet_downloadDir = 1;
|
||||
tr_strlcpy( args->downloadDir, directory, sizeof( args->downloadDir ) );
|
||||
} else {
|
||||
args->isSet_downloadDir = 0;
|
||||
*args->downloadDir = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
|
|
Loading…
Reference in a new issue