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

What does Git use instead for copying strings? snprintf?

Edit: also interesting is a search for alloca: https://github.com/git/git/search?utf8=&q=alloca&type=




Git has an internal "strbuf" library https://github.com/git/git/blob/master/strbuf.h


Alternatively it also uses snprintf, though as a small internal variant (xsnprintf) which literally kills the program if the destination buffer is too small: https://github.com/git/git/blob/master/wrapper.c#L636-L650




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

Search: