Introduce xbps_xasprintf() and use it where required.

--HG--
extra : convert_revision : 324a92a4824476059e0993d00c2b925c732a79f8
This commit is contained in:
Juan RP 2009-04-04 19:32:39 +02:00
parent f5dd58df5d
commit 4bf5c5f750
14 changed files with 108 additions and 175 deletions

View file

@ -39,12 +39,15 @@ xbps_register_repository(const char *uri)
prop_dictionary_t dict;
prop_array_t array;
prop_object_t obj = NULL;
const char *rootdir;
char *plist;
int rv = 0;
assert(uri != NULL);
plist = xbps_append_full_path(true, NULL, XBPS_REPOLIST);
rootdir = xbps_get_rootdir();
plist = xbps_xasprintf("%s/%s/%s", rootdir,
XBPS_META_PATH, XBPS_REPOLIST);
if (plist == NULL)
return errno;
@ -112,12 +115,15 @@ xbps_unregister_repository(const char *uri)
{
prop_dictionary_t dict;
prop_array_t array;
const char *rootdir;
char *plist;
int rv = 0;
assert(uri != NULL);
plist = xbps_append_full_path(true, NULL, XBPS_REPOLIST);
rootdir = xbps_get_rootdir();
plist = xbps_xasprintf("%s/%s/%s", rootdir,
XBPS_META_PATH, XBPS_REPOLIST);
if (plist == NULL)
return errno;