I came across this question in C programming:
Question: what is the flaw in the code snippet below that fills a buffer with zeros? How can the problem be fixed?
char*buf;
buf=malloc(BUFSIZ);
memset(buf,0,BUFSIZ);
I have tried to find the flaw, but everything works fine for me. Please let me know if there is any flaw in the above C program.