diff options
author | David Malone <dwmalone@FreeBSD.org> | 2002-04-13 21:28:17 +0000 |
---|---|---|
committer | David Malone <dwmalone@FreeBSD.org> | 2002-04-13 21:28:17 +0000 |
commit | 3cd2a589264bd06b46aa37377460eee13f407e3b (patch) | |
tree | 298c728f0f8fcbae522db3ddd83fde84004695e8 /usr.bin/limits/limits.c | |
parent | 72c7c2e6250a9f37eab13f2eb18f9cecd4e9bb1c (diff) | |
download | src-test2-3cd2a589264bd06b46aa37377460eee13f407e3b.tar.gz src-test2-3cd2a589264bd06b46aa37377460eee13f407e3b.zip |
Notes
Diffstat (limited to 'usr.bin/limits/limits.c')
-rw-r--r-- | usr.bin/limits/limits.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/usr.bin/limits/limits.c b/usr.bin/limits/limits.c index 642237c68d1d..21db848b6b2e 100644 --- a/usr.bin/limits/limits.c +++ b/usr.bin/limits/limits.c @@ -32,6 +32,7 @@ #include <stdlib.h> #include <unistd.h> #include <stdarg.h> +#include <stdint.h> #include <ctype.h> #include <errno.h> #include <pwd.h> @@ -184,7 +185,9 @@ static struct { { "limit%s sbsize %s", ";\n", 1 } } }, - { NULL } + { NULL, NULL, NULL, NULL, NULL, NULL, + { } + } }; static struct { @@ -283,7 +286,7 @@ main(int argc, char *argv[]) default: case ':': /* Without arg */ if ((p = strchr(rcs_string, optopt)) != NULL) { - int rcswhich = p - rcs_string; + int rcswhich1 = p - rcs_string; if (optarg && *optarg == '-') { /* 'arg' is actually a switch */ --optind; /* back one arg, and make arg NULL */ optarg = NULL; @@ -291,8 +294,8 @@ main(int argc, char *argv[]) todo = optarg == NULL ? RCSSEL : RCSSET; if (type == ANY) type = BOTH; - which_limits[rcswhich] = optarg ? type : DISPLAYONLY; - set_limits[rcswhich] = resource_num(rcswhich, optopt, optarg); + which_limits[rcswhich1] = optarg ? type : DISPLAYONLY; + set_limits[rcswhich1] = resource_num(rcswhich1, optopt, optarg); num_limits++; break; } @@ -468,7 +471,7 @@ print_limit(rlim_t limit, unsigned divisor, const char * inf, const char * pfx, if (limit == RLIM_INFINITY) strcpy(numbr, inf); else - sprintf(numbr, "%qd", (quad_t)((limit + divisor/2) / divisor)); + sprintf(numbr, "%jd", (intmax_t)((limit + divisor/2) / divisor)); printf(pfx, which, numbr); printf(sfx, which); @@ -580,7 +583,7 @@ getshellbyname(const char * shell) const char * q; const char * p = strrchr(shell, '/'); - p = p ? ++p : shell; + p = p ? p+1 : shell; for (i = 0; (q = shellparm[i].name) != NULL; i++) { while (*q) { int j = strcspn(q, "|"); |