xbps_xasprintf: do not return NULL anymore; remove checks for this.
This commit is contained in:
@@ -44,7 +44,6 @@ remove_pkg(const char *repodir, const char *arch, const char *file)
|
||||
|
||||
/* Remove real binpkg */
|
||||
filepath = xbps_xasprintf("%s/%s/%s", repodir, arch, file);
|
||||
assert(filepath);
|
||||
if (remove(filepath) == -1) {
|
||||
rv = errno;
|
||||
xbps_error_printf("failed to remove old binpkg `%s': %s\n",
|
||||
@@ -56,7 +55,6 @@ remove_pkg(const char *repodir, const char *arch, const char *file)
|
||||
|
||||
/* Remove symlink to binpkg */
|
||||
filepath = xbps_xasprintf("%s/%s", repodir, file);
|
||||
assert(filepath);
|
||||
if (remove(filepath) == -1) {
|
||||
rv = errno;
|
||||
xbps_error_printf("failed to remove old binpkg `%s': %s\n",
|
||||
|
||||
@@ -79,10 +79,7 @@ index_files_clean(struct xbps_handle *xhp, const char *repodir)
|
||||
/* pkg found, do nothing */
|
||||
continue;
|
||||
}
|
||||
if ((str = xbps_xasprintf("%s,%s", ipkgver, iarch)) == NULL) {
|
||||
rv = ENOMEM;
|
||||
goto out;
|
||||
}
|
||||
str = xbps_xasprintf("%s,%s", ipkgver, iarch);
|
||||
if (!prop_array_add_cstring(obsoletes, str)) {
|
||||
free(str);
|
||||
rv = EINVAL;
|
||||
|
||||
@@ -206,7 +206,6 @@ index_add(struct xbps_handle *xhp, int argc, char **argv)
|
||||
*/
|
||||
buf = xbps_xasprintf("`%s' (%s)",
|
||||
oldpkgver, oldarch);
|
||||
assert(buf);
|
||||
rv = remove_pkg(repodir,
|
||||
oldarch, oldfilen);
|
||||
if (rv != 0) {
|
||||
@@ -226,7 +225,6 @@ index_add(struct xbps_handle *xhp, int argc, char **argv)
|
||||
* index version.
|
||||
*/
|
||||
buf = xbps_xasprintf("`%s' (%s)", oldpkgver, oldarch);
|
||||
assert(buf);
|
||||
buf2 = strdup(oldpkgver);
|
||||
assert(buf2);
|
||||
rv = remove_pkg(repodir, oldarch, oldfilen);
|
||||
|
||||
Reference in New Issue
Block a user