Fix a bug in gitfo_read_file()
Fix a bug in gitfo_read_file()

In particular, when asked to read an empty file, this function
calls malloc() with a zero size allocation request. Standard C
says that the behaviour of malloc() in this case is implementation
defined.

[C99, 7.20.3 says "... If the size of the space requested is zero,
the behavior is implementation-defined: either a null pointer is
returned, or the behavior is as if the size were some nonzero
value, except that the returned pointer shall not be used to
access an object."]

Finesse the issue by over-allocating by one byte. Setting the extra
byte to '\0' may also provide a useful sentinel for text files.

Signed-off-by: Ramsay Jones <3e74413778ce9c8bebbbaedfd56741f6850faeaf@ramsay1.demon.co.uk>
Signed-off-by: Shawn O. Pearce <f01032651c12a22b2103346ba96b3b6b231f9d3c@spearce.org>

jeffhostetler/public_libgit2,ardumont/libgit2,zodiac/libgit2.js,claudelee/libgit2,rcorre/libgit2,oaastest/libgit2,yongthecoder/libgit2,jeffhostetler/public_libgit2,Aorjoa/libgit2_maked_lib,whoisj/libgit2,sim0629/libgit2,MrHacky/libgit2,nacho/libgit2,sim0629/libgit2,joshtriplett/libgit2,kissthink/libgit2,JIghtuse/libgit2,swisspol/DEMO-libgit2,zodiac/libgit2.js,yosefhackmon/libgit2,Snazz2001/libgit2,kissthink/libgit2,rcorre/libgit2,spraints/libgit2,linquize/libgit2,skabel/manguse,t0xicCode/libgit2,Corillian/libgit2,Aorjoa/libgit2_maked_lib,Aorjoa/libgit2_maked_lib,KTXSoftware/libgit2,jeffhostetler/public_libgit2,evhan/libgit2,mrksrm/Mingijura,nokiddin/libgit2,since2014/libgit2,mrksrm/Mingijura,kissthink/libgit2,since2014/libgit2,jamieleecool/ptest,kenprice/libgit2,saurabhsuniljain/libgit2,oaastest/libgit2,yongthecoder/libgit2,skabel/manguse,mcanthony/libgit2,yongthecoder/libgit2,t0xicCode/libgit2,stewid/libgit2,falqas/libgit2,dleehr/libgit2,sygool/libgit2,whoisj/libgit2,Snazz2001/libgit2,t0xicCode/libgit2,nokiddin/libgit2,mrksrm/Mingijura,oaastest/libgit2,Snazz2001/libgit2,Corillian/libgit2,maxiaoqian/libgit2,spraints/libgit2,iankronquist/libgit2,since2014/libgit2,sygool/libgit2,sygool/libgit2,Snazz2001/libgit2,nokiddin/libgit2,kissthink/libgit2,linquize/libgit2,magnus98/TEST,t0xicCode/libgit2,leoyanggit/libgit2,joshtriplett/libgit2,since2014/libgit2,jflesch/libgit2-mariadb,iankronquist/libgit2,JIghtuse/libgit2,skabel/manguse,chiayolin/libgit2,Corillian/libgit2,amyvmiwei/libgit2,joshtriplett/libgit2,kenprice/libgit2,Tousiph/Demo1,swisspol/DEMO-libgit2,since2014/libgit2,amyvmiwei/libgit2,amyvmiwei/libgit2,magnus98/TEST,falqas/libgit2,falqas/libgit2,MrHacky/libgit2,spraints/libgit2,KTXSoftware/libgit2,yosefhackmon/libgit2,kenprice/libgit2,kenprice/libgit2,kissthink/libgit2,amyvmiwei/libgit2,whoisj/libgit2,KTXSoftware/libgit2,sim0629/libgit2,nokiddin/libgit2,mcanthony/libgit2,JIghtuse/libgit2,chiayolin/libgit2,yongthecoder/libgit2,dleehr/libgit2,linquize/libgit2,mhp/libgit2,Tousiph/Demo1,claudelee/libgit2,maxiaoqian/libgit2,iankronquist/libgit2,dleehr/libgit2,evhan/libgit2,falqas/libgit2,mhp/libgit2,ardumont/libgit2,Snazz2001/libgit2,jamieleecool/ptest,mingyaaaa/libgit2,Aorjoa/libgit2_maked_lib,KTXSoftware/libgit2,JIghtuse/libgit2,jeffhostetler/public_libgit2,jflesch/libgit2-mariadb,sygool/libgit2,maxiaoqian/libgit2,mcanthony/libgit2,saurabhsuniljain/libgit2,yosefhackmon/libgit2,maxiaoqian/libgit2,yosefhackmon/libgit2,whoisj/libgit2,whoisj/libgit2,Tousiph/Demo1,magnus98/TEST,jflesch/libgit2-mariadb,mhp/libgit2,nacho/libgit2,joshtriplett/libgit2,t0xicCode/libgit2,linquize/libgit2,mingyaaaa/libgit2,swisspol/DEMO-libgit2,whoisj/libgit2,saurabhsuniljain/libgit2,mrksrm/Mingijura,spraints/libgit2,yongthecoder/libgit2,magnus98/TEST,rcorre/libgit2,skabel/manguse,rcorre/libgit2,dleehr/libgit2,nokiddin/libgit2,ardumont/libgit2,leoyanggit/libgit2,nokiddin/libgit2,Corillian/libgit2,zodiac/libgit2.js,leoyanggit/libgit2,MrHacky/libgit2,MrHacky/libgit2,linquize/libgit2,jeffhostetler/public_libgit2,spraints/libgit2,Tousiph/Demo1,mingyaaaa/libgit2,saurabhsuniljain/libgit2,claudelee/libgit2,claudelee/libgit2,raybrad/libit2,raybrad/libit2,zodiac/libgit2.js,sygool/libgit2,mingyaaaa/libgit2,stewid/libgit2,nacho/libgit2,sygool/libgit2,skabel/manguse,mrksrm/Mingijura,Corillian/libgit2,mcanthony/libgit2,swisspol/DEMO-libgit2,oaastest/libgit2,leoyanggit/libgit2,KTXSoftware/libgit2,zodiac/libgit2.js,iankronquist/libgit2,iankronquist/libgit2,yosefhackmon/libgit2,leoyanggit/libgit2,evhan/libgit2,yosefhackmon/libgit2,stewid/libgit2,Snazz2001/libgit2,stewid/libgit2,yongthecoder/libgit2,jflesch/libgit2-mariadb,t0xicCode/libgit2,jamieleecool/ptest,dleehr/libgit2,oaastest/libgit2,ardumont/libgit2,mrksrm/Mingijura,oaastest/libgit2,MrHacky/libgit2,dleehr/libgit2,since2014/libgit2,claudelee/libgit2,Corillian/libgit2,ardumont/libgit2,mhp/libgit2,mingyaaaa/libgit2,evhan/libgit2,Aorjoa/libgit2_maked_lib,sim0629/libgit2,mhp/libgit2,rcorre/libgit2,linquize/libgit2,Tousiph/Demo1,maxiaoqian/libgit2,iankronquist/libgit2,claudelee/libgit2,chiayolin/libgit2,jflesch/libgit2-mariadb,mcanthony/libgit2,nacho/libgit2,falqas/libgit2,KTXSoftware/libgit2,chiayolin/libgit2,mhp/libgit2,JIghtuse/libgit2,sim0629/libgit2,chiayolin/libgit2,sim0629/libgit2,swisspol/DEMO-libgit2,kenprice/libgit2,jflesch/libgit2-mariadb,kissthink/libgit2,jeffhostetler/public_libgit2,MrHacky/libgit2,joshtriplett/libgit2,mcanthony/libgit2,JIghtuse/libgit2,chiayolin/libgit2,magnus98/TEST,raybrad/libit2,joshtriplett/libgit2,magnus98/TEST,skabel/manguse,Tousiph/Demo1,ardumont/libgit2,swisspol/DEMO-libgit2,rcorre/libgit2,stewid/libgit2,mingyaaaa/libgit2,saurabhsuniljain/libgit2,maxiaoqian/libgit2,spraints/libgit2,raybrad/libit2,amyvmiwei/libgit2,jamieleecool/ptest,amyvmiwei/libgit2,falqas/libgit2,leoyanggit/libgit2,stewid/libgit2,raybrad/libit2,saurabhsuniljain/libgit2,kenprice/libgit2