diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-08-07 13:30:08 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-08-07 13:30:08 +0000 |
commit | 44cf9c6d2d274eac37502e835155f7e985f1b8e6 (patch) | |
tree | 9576ba968924c5b9a55ba9e14f4f26184c62c7d4 /src/deb/info.c | |
parent | Adding upstream version 1.22.6. (diff) | |
download | dpkg-44cf9c6d2d274eac37502e835155f7e985f1b8e6.tar.xz dpkg-44cf9c6d2d274eac37502e835155f7e985f1b8e6.zip |
Adding upstream version 1.22.7.upstream/1.22.7
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/deb/info.c')
-rw-r--r-- | src/deb/info.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/deb/info.c b/src/deb/info.c index 6598663..d2d72cf 100644 --- a/src/deb/info.c +++ b/src/deb/info.c @@ -93,11 +93,11 @@ info_spew(const char *debar, const char *dir, const char *const *argv) varbuf_reset(&controlfile); varbuf_printf(&controlfile, "%s/%s", dir, component); - fd = open(controlfile.buf, O_RDONLY); + fd = open(varbuf_str(&controlfile), O_RDONLY); if (fd >= 0) { if (fd_fd_copy(fd, 1, -1, &err) < 0) ohshit(_("cannot extract control file '%s' from '%s': %s"), - controlfile.buf, debar, err.str); + varbuf_str(&controlfile), debar, err.str); close(fd); } else if (errno == ENOENT) { notice(_("'%.255s' contains no control component '%.255s'"), @@ -159,7 +159,7 @@ info_list(const char *debar, const char *dir) FILE *cc; cdn = scandir(dir, &cdlist, &ilist_select, alphasort); - if (cdn == -1) + if (cdn < 0) ohshite(_("cannot scan directory '%.255s'"), dir); for (n = 0; n < cdn; n++) { @@ -259,12 +259,11 @@ info_field(const char *debar, const char *dir, const char *const *fields, if (arbfield) varbuf_add_arbfield(&str, arbfield, fieldflags); } - varbuf_end_str(&str); if (fieldflags & fw_printheader) - printf("%s", str.buf); + printf("%s", varbuf_str(&str)); else - printf("%s\n", str.buf); + printf("%s\n", varbuf_str(&str)); } m_output(stdout, _("<standard output>")); |