Hacker News new | past | comments | ask | show | jobs | submit login

Just replace strcpy(a,b) with strcpyn(a,b,INT_MAX)

/joke




I'm pretty sure I've seen similar logic in my life.


Been a while, eh?

It should be strncpy(a,b,(size_t)-1)!


SIZE_MAX does exist.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: