I am trying to implement a function with a variable arguments. The pointer 'fmt' becomes NULL and crashes.
The moment it enters st_sdpf() function, fmt becomes NULL. Is there any option setting setting required here??
int st_sdpf(int stream, const char *fmt, ... )
{
if (fmt == NULL)
{
platform_write("error in st_dpf: NULL fmt\n");
return (-1);
}.
......................
}
This problem of crash or NULL - fmt occurs only if the st_sdpf() has more than one argument. if st_sdpf(const char *fmt), this is fine.