How do I prevent a char pointer buffer overflow?
- by Tommy
i.e. -
function(char* txt)
{
sprintf(txt, "select * from %s;", table);
//How do I set last char in buffer to NULL here?
}
so if the text in table some how was 500 chars long and txt in the main was only defined as 100....
thanks.