From 2a76c8a41cd28e49bf0577345a459cf9307e7d15 Mon Sep 17 00:00:00 2001 From: sjg Date: Sun, 14 Sep 2008 05:00:23 +0000 Subject: [PATCH] Avoid sign extention problems leading to: $ ulimit -dH 3145728 $ ulimit -d 3145728 ksh: ulimit: bad limit: Invalid argument $ --- bin/ksh/c_ulimit.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/ksh/c_ulimit.c b/bin/ksh/c_ulimit.c index a719047d0210..b24c94fd6262 100644 --- a/bin/ksh/c_ulimit.c +++ b/bin/ksh/c_ulimit.c @@ -1,4 +1,4 @@ -/* $NetBSD: c_ulimit.c,v 1.8 2006/10/16 00:07:32 christos Exp $ */ +/* $NetBSD: c_ulimit.c,v 1.9 2008/09/14 05:00:23 sjg Exp $ */ /* ulimit -- handle "ulimit" builtin @@ -20,7 +20,7 @@ #include #ifndef lint -__RCSID("$NetBSD: c_ulimit.c,v 1.8 2006/10/16 00:07:32 christos Exp $"); +__RCSID("$NetBSD: c_ulimit.c,v 1.9 2008/09/14 05:00:23 sjg Exp $"); #endif @@ -193,7 +193,7 @@ c_ulimit(wp) bi_errorf("invalid limit: %s", wp[0]); return 1; } - val = rval * l->factor; + val = (u_long)rval * l->factor; } } if (all) {