Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libutil - pass correct types.
details: https://anonhg.NetBSD.org/src/rev/d801c486735a
branches: trunk
changeset: 778654:d801c486735a
user: christos <christos%NetBSD.org@localhost>
date: Sat Apr 07 16:16:34 2012 +0000
description:
- pass correct types.
- use sizeof(var) instead of sizeof(type)
diffstat:
lib/libutil/login_cap.c | 22 +++++++++++-----------
1 files changed, 11 insertions(+), 11 deletions(-)
diffs (61 lines):
diff -r 9ec7315dec32 -r d801c486735a lib/libutil/login_cap.c
--- a/lib/libutil/login_cap.c Sat Apr 07 11:56:27 2012 +0000
+++ b/lib/libutil/login_cap.c Sat Apr 07 16:16:34 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: login_cap.c,v 1.29 2007/12/04 22:09:02 mjf Exp $ */
+/* $NetBSD: login_cap.c,v 1.30 2012/04/07 16:16:34 christos Exp $ */
/*-
* Copyright (c) 1995,1997 Berkeley Software Design, Inc. All rights reserved.
@@ -36,7 +36,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: login_cap.c,v 1.29 2007/12/04 22:09:02 mjf Exp $");
+__RCSID("$NetBSD: login_cap.c,v 1.30 2012/04/07 16:16:34 christos Exp $");
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
@@ -444,25 +444,25 @@
return (-1);
}
-#define RCUR r.rlim_cur
-#define RMAX r.rlim_max
+#define RCUR ((quad_t)r.rlim_cur)
+#define RMAX ((quad_t)r.rlim_max)
switch (type) {
case R_CTIME:
- RCUR = login_getcaptime(lc, name, RCUR, RCUR);
- RMAX = login_getcaptime(lc, name, RMAX, RMAX);
+ r.rlim_cur = login_getcaptime(lc, name, RCUR, RCUR);
+ r.rlim_max = login_getcaptime(lc, name, RMAX, RMAX);
rl.rlim_cur = login_getcaptime(lc, name_cur, RCUR, RCUR);
rl.rlim_max = login_getcaptime(lc, name_max, RMAX, RMAX);
break;
case R_CSIZE:
- RCUR = login_getcapsize(lc, name, RCUR, RCUR);
- RMAX = login_getcapsize(lc, name, RMAX, RMAX);
+ r.rlim_cur = login_getcapsize(lc, name, RCUR, RCUR);
+ r.rlim_max = login_getcapsize(lc, name, RMAX, RMAX);
rl.rlim_cur = login_getcapsize(lc, name_cur, RCUR, RCUR);
rl.rlim_max = login_getcapsize(lc, name_max, RMAX, RMAX);
break;
case R_CNUMB:
- RCUR = login_getcapnum(lc, name, RCUR, RCUR);
- RMAX = login_getcapnum(lc, name, RMAX, RMAX);
+ r.rlim_cur = login_getcapnum(lc, name, RCUR, RCUR);
+ r.rlim_max = login_getcapnum(lc, name, RMAX, RMAX);
rl.rlim_cur = login_getcapnum(lc, name_cur, RCUR, RCUR);
rl.rlim_max = login_getcapnum(lc, name_max, RMAX, RMAX);
break;
@@ -513,7 +513,7 @@
/* allocate ptr array and string */
count = i;
- res = malloc(count * sizeof(char *) + strlen(str) + 1);
+ res = malloc(count * sizeof(*res) + strlen(str) + 1);
if (!res)
return -1;
Home |
Main Index |
Thread Index |
Old Index