From: Paul Eggert Date: Tue, 2 Mar 1999 00:10:11 +0000 (+0000) Subject: (gid_from_oct, major_from_oct, minor_from_oct, mode_from_oct, off_from_oct, X-Git-Url: https://git.dogcows.com/gitweb?a=commitdiff_plain;h=545ec1a3fae8b395a82ccc0840f313e0b4f16bf1;p=chaz%2Ftar (gid_from_oct, major_from_oct, minor_from_oct, mode_from_oct, off_from_oct, size_from_oct, time_from_oct, uid_from_oct, uintmax_from_oct): Use TYPE_MAXIMUM instead of macros like OFF_MAX, which are not reliable (e.g. OFF_MAX in AIX 4.2 is incorrect). --- diff --git a/src/list.c b/src/list.c index 7571035..a3b3830 100644 --- a/src/list.c +++ b/src/list.c @@ -587,47 +587,47 @@ from_oct (const char *where0, size_t digs0, const char *type, uintmax_t maxval) gid_t gid_from_oct (const char *p, size_t s) { - return from_oct (p, s, "gid_t", (uintmax_t) GID_MAX); + return from_oct (p, s, "gid_t", (uintmax_t) TYPE_MAXIMUM (gid_t)); } major_t major_from_oct (const char *p, size_t s) { - return from_oct (p, s, "major_t", (uintmax_t) MAJOR_MAX); + return from_oct (p, s, "major_t", (uintmax_t) TYPE_MAXIMUM (major_t)); } minor_t minor_from_oct (const char *p, size_t s) { - return from_oct (p, s, "minor_t", (uintmax_t) MINOR_MAX); + return from_oct (p, s, "minor_t", (uintmax_t) TYPE_MAXIMUM (minor_t)); } mode_t mode_from_oct (const char *p, size_t s) { - return from_oct (p, s, "mode_t", (uintmax_t) MODE_MAX); + return from_oct (p, s, "mode_t", (uintmax_t) TYPE_MAXIMUM (mode_t)); } off_t off_from_oct (const char *p, size_t s) { - return from_oct (p, s, "off_t", (uintmax_t) OFF_MAX); + return from_oct (p, s, "off_t", (uintmax_t) TYPE_MAXIMUM (off_t)); } size_t size_from_oct (const char *p, size_t s) { - return from_oct (p, s, "size_t", (uintmax_t) SIZE_MAX); + return from_oct (p, s, "size_t", (uintmax_t) TYPE_MAXIMUM (size_t)); } time_t time_from_oct (const char *p, size_t s) { - return from_oct (p, s, "time_t", (uintmax_t) TIME_MAX); + return from_oct (p, s, "time_t", (uintmax_t) TYPE_MAXIMUM (time_t)); } uid_t uid_from_oct (const char *p, size_t s) { - return from_oct (p, s, "uid_t", (uintmax_t) UID_MAX); + return from_oct (p, s, "uid_t", (uintmax_t) TYPE_MAXIMUM (uid_t)); } uintmax_t uintmax_from_oct (const char *p, size_t s) { - return from_oct (p, s, "uintmax_t", UINTMAX_MAX); + return from_oct (p, s, "uintmax_t", TYPE_MAXIMUM (uintmax_t)); }