xbps_xasprintf: do not return NULL anymore; remove checks for this.
This commit is contained in:
@@ -71,10 +71,6 @@ check_pkg_files(struct xbps_handle *xhp,
|
||||
while ((obj = prop_object_iterator_next(iter))) {
|
||||
prop_dictionary_get_cstring_nocopy(obj, "file", &file);
|
||||
path = xbps_xasprintf("%s/%s", xhp->rootdir, file);
|
||||
if (path == NULL) {
|
||||
prop_object_iterator_release(iter);
|
||||
return -1;
|
||||
}
|
||||
prop_dictionary_get_cstring_nocopy(obj,
|
||||
"sha256", &sha256);
|
||||
rv = xbps_file_hash_check(path, sha256);
|
||||
@@ -124,10 +120,6 @@ check_pkg_files(struct xbps_handle *xhp,
|
||||
while ((obj = prop_object_iterator_next(iter))) {
|
||||
prop_dictionary_get_cstring_nocopy(obj, "file", &file);
|
||||
path = xbps_xasprintf("%s/%s", xhp->rootdir, file);
|
||||
if (path == NULL) {
|
||||
prop_object_iterator_release(iter);
|
||||
return -1;
|
||||
}
|
||||
if ((rv = access(path, R_OK)) == -1) {
|
||||
if (errno == ENOENT) {
|
||||
xbps_error_printf(
|
||||
|
@@ -78,9 +78,6 @@ check_pkg_symlinks(struct xbps_handle *xhp,
|
||||
continue;
|
||||
}
|
||||
path = xbps_xasprintf("%s/%s", xhp->rootdir, file);
|
||||
if (path == NULL)
|
||||
return -1;
|
||||
|
||||
if ((buf = realpath(path, NULL)) == NULL) {
|
||||
xbps_error_printf("%s: broken symlink `%s': "
|
||||
"%s\n", pkgname, file, strerror(errno));
|
||||
@@ -91,7 +88,6 @@ check_pkg_symlinks(struct xbps_handle *xhp,
|
||||
/* relative symlink target */
|
||||
dname = dirname(path);
|
||||
buf2 = xbps_xasprintf("%s/%s", dname, tgt);
|
||||
assert(buf2);
|
||||
buf3 = realpath(buf2, NULL);
|
||||
assert(buf3);
|
||||
free(buf2);
|
||||
|
Reference in New Issue
Block a user