2 8951cb19 2022-07-01 op * Copyright (c) 2015 Ingo Schwarze <schwarze@openbsd.org>
4 8951cb19 2022-07-01 op * Permission to use, copy, modify, and distribute this software for any
5 8951cb19 2022-07-01 op * purpose with or without fee is hereby granted, provided that the above
6 8951cb19 2022-07-01 op * copyright notice and this permission notice appear in all copies.
8 8951cb19 2022-07-01 op * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 8951cb19 2022-07-01 op * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 8951cb19 2022-07-01 op * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 8951cb19 2022-07-01 op * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 8951cb19 2022-07-01 op * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 8951cb19 2022-07-01 op * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 8951cb19 2022-07-01 op * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 8951cb19 2022-07-01 op #ifdef __NetBSD__
17 8951cb19 2022-07-01 op # define _OPENBSD_SOURCE
19 8951cb19 2022-07-01 op #include <stdlib.h>
24 8951cb19 2022-07-01 op const char *errstr;
26 8951cb19 2022-07-01 op if (strtonum("1", 0, 2, &errstr) != 1)
28 8951cb19 2022-07-01 op if (errstr != NULL)
30 8951cb19 2022-07-01 op if (strtonum("1x", 0, 2, &errstr) != 0)
32 8951cb19 2022-07-01 op if (errstr == NULL)
34 8951cb19 2022-07-01 op if (strtonum("2", 0, 1, &errstr) != 0)
36 8951cb19 2022-07-01 op if (errstr == NULL)
38 8951cb19 2022-07-01 op if (strtonum("0", 1, 2, &errstr) != 0)
40 8951cb19 2022-07-01 op if (errstr == NULL)