Fix a usage error in a call to the object_file_name() function
Fix a usage error in a call to the object_file_name() function

In 82324ac, the new static function exists_loose() called
object_file_name() and, in order to detect an error return,
tested for a negative value. This usage is incorrect, as
the error return is indicated by a positive return value.
(A successful call is indicated by a zero return value)

The only error return from object_file_name() relates to
insufficient buffer space and the return value gives the
required minimum buffer size (which will always be >0).

If the caller requires a dynamically allocated buffer,
this allows something like the following call sequence:

    size_t len = object_file_name(NULL, 0, db->object_dir, id);
    char *buf = git__malloc(len);
    if (!buf)
        error(...);
    object_file_name(buf, len, db->object_dir,id);
    ...

No current callers take advantage of this capability.

Fix up the call site and change the return type of the
function, from int to size_t, which more accurately
reflects the implementation.

Signed-off-by: Ramsay Jones <3e74413778ce9c8bebbbaedfd56741f6850faeaf@ramsay1.demon.co.uk>
Signed-off-by: Andreas Ericsson <1eabdaf488b3a3682bbca94c5f468f065cdfaf13@op5.se>

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