(*filelist[items]) = malloc(strlen(filename)+1);
Instead of that you probably want
(*filelist)[items] = malloc(strlen(filename)+1);
assuming that filelist is a char*** as bithub and itCbitC...
Type: Posts; User: dwks
(*filelist[items]) = malloc(strlen(filename)+1);
Instead of that you probably want
(*filelist)[items] = malloc(strlen(filename)+1);
assuming that filelist is a char*** as bithub and itCbitC...
I guess I wasn't clear: if you use calloc(), you zero the memory and then overwrite it. If you use malloc(), you never spend time zeroing memory which is just going to be overwritten anyway.
Of...
For what it's worth, calloc() zeros out the memory it allocates, but you go and overwrite the data with a strcpy() immediately afterwards -- so I'd be inclined to use malloc() instead of calloc() to...