[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.0708030958450.495@fbirervta.pbzchgretzou.qr>
Date: Fri, 3 Aug 2007 09:59:59 +0200 (CEST)
From: Jan Engelhardt <jengelh@...putergmbh.de>
To: Satyam Sharma <satyam@...radead.org>
cc: Alexey Dobriyan <adobriyan@...il.com>,
Andrew Morton <akpm@...ux-foundation.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH -mm] Introduce strtol_check_range()
On Aug 2 2007 05:16, Satyam Sharma wrote:
>
>BSD's strtonum(3) is a detestful, horrible shame.
>
>The strtol_check_range() I implemented here does _all_ that strtonum()
>does, plus is generic w.r.t. base, and minus the tasteless "errstr"
>argument.
>
>Tell me, how does that "errstr" ever make sense? We _anyway_ return
>errors (-EINVAL or -ERANGE) if any of those cases show up.
errstr (well, at least for strtol) are useful to find the first character that
does not make up a number (and then do whatever the user wants to, including,
continuing to parse). For example "chown 0:1337", strtol on "0:1337" should
give errstr=pointer to the ":", then check for it being a ':', then you know
the next char is the GID. :)
Jan
--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists