-/*
-** Copyright (C) 2006- Sami Kerola <kerolasa@iki.fi>
-**
-** This program is free software; you can redistribute it and/or modify
+/* http://dhcpd-pools.sourceforge.net/
+** Copyright 2006- Sami Kerola <kerolasa@iki.fi>
+**
+** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
+** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
-**
+**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
-**
+**
** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifdef HAVE_CONFIG_H
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
+#include <errno.h>
+#include <err.h>
#include "dhcpd-pools.h"
-#include "defaults.h"
/* Sort functions for range sorting */
int intcomp(const void *x, const void *y)
returner = ret_tcperc;
break;
default:
- eprintf("field_selector: unknown sort order: %c",
- config.sort[0]);
- usage(EXIT_FAILURE);
+ warnx("field_selector: unknown sort order `%c'", c);
+ errx(EXIT_FAILURE, "Try `%s --help' for more information.",
+ program_invocation_short_name);
}
}
{
int left, right, i;
struct range_t hold;
+ /* Merge sort split size */
+ static const int MIN_MERGE_SIZE = 8;
if (size < MIN_MERGE_SIZE) {
for (left = 0; left < size; left++) {