Is there a function prototype for list_dir before this?
If so maybe it's different from the function definition.