Introduce xbps_xasprintf() and use it where required.
--HG-- extra : convert_revision : 324a92a4824476059e0993d00c2b925c732a79f8
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user