5 ms·
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=
by saagarjha 7y ago
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= https://github.com/git/git/search?utf8=&q=alloca&type=
- LukeShu 7y agoGit has an internal "strbuf" library https://github.com/git/git/blob/master/strbuf.h https://github.com/git/git/blob/master/strbuf.h
- masklinn 7y agoAlternatively 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 https://github.com/git/git/blob/master/wrapper.c#L636-L650