diff options
author | mux <mux@FreeBSD.org> | 2002-10-01 11:44:38 +0000 |
---|---|---|
committer | mux <mux@FreeBSD.org> | 2002-10-01 11:44:38 +0000 |
commit | bad1a9d8524b93e5cd5e0cb4fc49fbe8fae5460d (patch) | |
tree | 224d6cd83c9274b4474a528892ee210299c449d2 /bin | |
parent | e4147dd2dc9eb0b295eb3a05fe40edd18625c60b (diff) | |
download | FreeBSD-src-bad1a9d8524b93e5cd5e0cb4fc49fbe8fae5460d.zip FreeBSD-src-bad1a9d8524b93e5cd5e0cb4fc49fbe8fae5460d.tar.gz |
- Don't use quad_t when we really mean rlim_t.
- Cast rlim_t to intmax_t when printing it.
This should fix the last format errors in sh(1).
Tested on: i386, sparc64
Diffstat (limited to 'bin')
-rw-r--r-- | bin/sh/miscbltin.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/bin/sh/miscbltin.c b/bin/sh/miscbltin.c index 26e7fcb..bdd22e0 100644 --- a/bin/sh/miscbltin.c +++ b/bin/sh/miscbltin.c @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include <unistd.h> #include <ctype.h> #include <errno.h> +#include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <termios.h> @@ -352,7 +353,7 @@ int ulimitcmd(int argc __unused, char **argv __unused) { int c; - quad_t val = 0; + rlim_t val = 0; enum { SOFT = 0x1, HARD = 0x2 } how = SOFT | HARD; const struct limits *l; @@ -390,12 +391,12 @@ ulimitcmd(int argc __unused, char **argv __unused) if (strcmp(p, "unlimited") == 0) val = RLIM_INFINITY; else { - val = (quad_t) 0; + val = 0; while ((c = *p++) >= '0' && c <= '9') { val = (val * 10) + (long)(c - '0'); - if (val < (quad_t) 0) + if (val < 0) break; } if (c) @@ -425,7 +426,7 @@ ulimitcmd(int argc __unused, char **argv __unused) else { val /= l->factor; - out1fmt("%qd\n", (quad_t) val); + out1fmt("%jd\n", (intmax_t)val); } } return 0; @@ -451,7 +452,7 @@ ulimitcmd(int argc __unused, char **argv __unused) else { val /= l->factor; - out1fmt("%qd\n", (quad_t) val); + out1fmt("%jd\n", (intmax_t)val); } } return 0; |