/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * Copyright 2000-2005 The OpenLDAP Foundation.
+ * Copyright 2000-2006 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
#include <stdio.h>
#include <rewrite.h>
+#include <lutil.h>
#include <ldap.h>
int ldap_debug;
FILE *fin = NULL;
char *rewriteContext = REWRITE_DEFAULT_CONTEXT;
int debug = 0;
- char *next;
while ( 1 ) {
int opt = getopt( argc, argv, "d:f:hr:" );
switch ( opt ) {
case 'd':
- debug = strtol( optarg, &next, 10 );
- if ( next == NULL || next[0] != '\0' ) {
+ if ( lutil_atoi( &debug, optarg ) != 0 ) {
fprintf( stderr, "illegal log level '%s'\n",
optarg );
exit( EXIT_FAILURE );