My program core dumps because of this routine. Can anyone tell me what's wrong with it? I have written similar functions in the past and never had an issue.Code:I have written the following code which accepts variable arguments: void dprintf(FILE *fp,char *fmt,...) { char OldMsg[BUFSIZ]; va_list lArgs; if(fmt && *fmt) { fmt[strlen(fmt)-1]='\0'; /* Remove ending \n */ va_start(lArgs, fmt); vsprintf(OldMsg, fmt, lArgs); va_end(lArgs); fprintf(fp, "%s at %s_%02d\n", OldMsg, Run.date, Run.hour); } } I am calling the function as follows: dprintf(flog,"\t%s(%s): Unable to insert node\n", program_name, sccs_ver);