diff options
Diffstat (limited to 'src/deb')
-rw-r--r-- | src/deb/build.c | 10 | ||||
-rw-r--r-- | src/deb/extract.c | 2 | ||||
-rw-r--r-- | src/deb/info.c | 11 | ||||
-rw-r--r-- | src/deb/main.c | 2 |
4 files changed, 13 insertions, 12 deletions
diff --git a/src/deb/build.c b/src/deb/build.c index 1f0c050..a418dd1 100644 --- a/src/deb/build.c +++ b/src/deb/build.c @@ -544,7 +544,9 @@ parse_timestamp(const char *value) errno = 0; timestamp = strtoimax(value, &end, 10); - if (value == end || *end || errno != 0) + if (value == end || *end) + ohshit(_("unable to parse timestamp '%.255s'"), value); + else if (errno != 0) ohshite(_("unable to parse timestamp '%.255s'"), value); return timestamp; @@ -597,7 +599,7 @@ do_build(const char *const *argv) m_output(stdout, _("<standard output>")); timestamp_str = getenv("SOURCE_DATE_EPOCH"); - if (timestamp_str) + if (str_is_set(timestamp_str)) timestamp = parse_timestamp(timestamp_str); else timestamp = time(NULL); @@ -614,7 +616,7 @@ do_build(const char *const *argv) * unlink our temporary file so others can't mess with it. */ tfbuf = path_make_temp_template("dpkg-deb"); gzfd = mkstemp(tfbuf); - if (gzfd == -1) + if (gzfd < 0) ohshite(_("failed to make temporary file (%s)"), _("control member")); /* Make sure it's gone, the fd will remain until we close it. */ if (unlink(tfbuf)) @@ -686,7 +688,7 @@ do_build(const char *const *argv) * temporary file so others can't mess with it. */ tfbuf = path_make_temp_template("dpkg-deb"); gzfd = mkstemp(tfbuf); - if (gzfd == -1) + if (gzfd < 0) ohshite(_("failed to make temporary file (%s)"), _("data member")); /* Make sure it's gone, the fd will remain until we close it. */ if (unlink(tfbuf)) diff --git a/src/deb/extract.c b/src/deb/extract.c index 8b78a7e..08b2815 100644 --- a/src/deb/extract.c +++ b/src/deb/extract.c @@ -364,7 +364,7 @@ extracthalf(const char *debar, const char *dir, } subproc_reap(c2, _("<decompress>"), SUBPROC_NOPIPE); - if (c1 != -1) + if (c1 >= 0) subproc_reap(c1, _("paste"), 0); if (version.major == 0 && admininfo) { /* Handle the version as a float to preserve the behavior of old code, 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>")); diff --git a/src/deb/main.c b/src/deb/main.c index 2c53811..b7fe11c 100644 --- a/src/deb/main.c +++ b/src/deb/main.c @@ -26,7 +26,7 @@ #include <sys/wait.h> #include <limits.h> -#if HAVE_LOCALE_H +#ifdef HAVE_LOCALE_H #include <locale.h> #endif #include <errno.h> |