Hi Friends,
I was developing a function for making entries to log files in c++
My function looks like this:
void makeLog(int log_level,char *arg,...)
{
char temp_str[512]={0,};
va_list ap;
va_start(ap,arg);
vsprintf(temp_str,arg,ap);
..
..
}
this function works well most of the time, but some time it generates a core dump at line
vsprintf(temp_str,arg,ap);
The string i am sending is also not longer than 512 bytes.
Im using multiple threds , which calls this makeLog function.
can any body give me a solution how can i overcome this problem
waiting for your responses.
Thanks and Regards
Pardeep