Re: [wmii] Bug(?) with selecting pages out of range

From: Anselm R. Garbe <garbeam_AT_wmii.de>
Date: Thu, 15 Dec 2005 00:50:22 +0100

On Wed, Dec 14, 2005 at 06:50:14PM +0000, Adam Gleave wrote:
> If you select a page out of range (e.g. alt+shift+9 when there isn't
> a tenth page) you end up on page 0. I kind of like this as it's often
> quicker to get to page 0 but none the less it's unexpected.
>
> A patch that fixes this is enclosed. I don't really like how I've done
> it, but I can't think of a better way.

Hmm, to me it is very brave to use the errno side-effect of cext_strtonum ;)
Instead I'd recommend something like:
[...]
        char *errstr;
        unsinged idx = cext_strtonum(arg, 0, cext_sizeof_container(pages), &errstr);
        sel_page(cext_list_get_item(&pages, errstr ? 0 : idx));
[...]

Regards.

-- 
 Anselm R. Garbe  ><><  www.ebrag.de  ><><  GPG key: 0D73F361
Received on Thu Dec 15 2005 - 00:50:22 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:59:37 UTC