Fix potential segfault (42)
This commit is contained in:
parent
10afb1cd9b
commit
e87605ad86
@ -60,11 +60,10 @@ int main(int argc, char *argv[]) {
|
|||||||
rewinddir(d);
|
rewinddir(d);
|
||||||
|
|
||||||
char *data = strdup(datadir);
|
char *data = strdup(datadir);
|
||||||
time_t t;
|
|
||||||
|
|
||||||
srand((unsigned)time(&t));
|
srand((unsigned)time(NULL));
|
||||||
|
|
||||||
int m = rand() % n;
|
int m = rand() % (n - 1);
|
||||||
strncat(data, filesList[m], 4);
|
strncat(data, filesList[m], 4);
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
char *line = NULL;
|
char *line = NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user