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, 5 months ago) by misho
Branches: confuse, MAIN
CVS tags: v3_3, v2_7, HEAD
confuse 2.7

    1: int validate_unsigned_int(cfg_t *cfg, cfg_opt_t *opt)
    2: {
    3:     int value = cfg_opt_getnint(opt, cfg_opt_size(opt) - 1);
    4:     if(value < 0)
    5:     {
    6:         cfg_error(cfg, "integer option '%s' must be positive in section '%s'",
    7:                 opt->name, cfg->name);
    8:         return -1;
    9:     }
   10:     return 0;
   11: }
   12: 

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