File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / confuse / doc / listing7.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Jan 24 14:48:55 2017 UTC (7 years, 4 months ago) by misho
Branches: confuse, MAIN
CVS tags: v3_3, v2_7, HEAD
confuse 2.7

int validate_unsigned_int(cfg_t *cfg, cfg_opt_t *opt)
{
    int value = cfg_opt_getnint(opt, cfg_opt_size(opt) - 1);
    if(value < 0)
    {
        cfg_error(cfg, "integer option '%s' must be positive in section '%s'",
                opt->name, cfg->name);
        return -1;
    }
    return 0;
}


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>