mirror of
https://github.com/Tha14/toxic.git
synced 2024-11-26 08:13:27 +01:00
Fix segfault when using -f in toxic
Call strdup() to the data file argument string to avoid segmentation fault when it is later freed.
This commit is contained in:
parent
42028289c5
commit
9cabdaa6a0
2
main.c
2
main.c
@ -218,7 +218,7 @@ int main(int argc, char *argv[])
|
|||||||
else if (argv[i][0] == '-') {
|
else if (argv[i][0] == '-') {
|
||||||
if (argv[i][1] == 'f') {
|
if (argv[i][1] == 'f') {
|
||||||
if (argv[i + 1] != NULL)
|
if (argv[i + 1] != NULL)
|
||||||
DATA_FILE = argv[i + 1];
|
DATA_FILE = strdup(argv[i + 1]);
|
||||||
else
|
else
|
||||||
f_flag = -1;
|
f_flag = -1;
|
||||||
} else if (argv[i][1] == 'n') {
|
} else if (argv[i][1] == 'n') {
|
||||||
|
Loading…
Reference in New Issue
Block a user