Use INT_MIN instead of INT_MAX when checking for negative out of range values. Regression introduced in commit 2bf4b48a9a6f7ddf854179b4b74013534e4594b9. Closes: #676796
@@ -1,3 +1,10 @@
+dpkg (1.16.4.2) UNRELEASED; urgency=low
+
+ * Check correctly for out of range negative field width values in dpkg-query
+ --show format strings. Regression introduced in 1.16.4. Closes: #676796
+ -- Guillem Jover <guillem@debian.org> Sat, 09 Jun 2012 16:10:33 +0200
dpkg (1.16.4.1) unstable; urgency=low
* Fix explicit file trigger activation. Regression introduced in 1.16.4.
@@ -86,7 +86,7 @@ parsefield(struct pkg_format_node *cur, const char *fmt, const char *fmtend)
*endptr);
return false;
}
- if (w < INT_MAX || w > INT_MAX || errno == ERANGE) {
+ if (w < INT_MIN || w > INT_MAX || errno == ERANGE) {
fprintf(stderr, _("field width is out of range\n"));