xbps_xasprintf: do not return NULL anymore; remove checks for this.

This commit is contained in:
Juan RP
2012-11-11 09:37:27 +01:00
parent 0ab60b24c5
commit d6735d5685
27 changed files with 4 additions and 143 deletions

View File

@@ -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(

View File

@@ -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);