X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;ds=sidebyside;f=libraries%2Flibrewrite%2Frewrite.c;h=372018ac74f45ebfd19d4eb337ed7adfcc759617;hb=ae471f78c32d7531c729aa88116b8b413cc200bf;hp=b040ee7fd2b2a755c18801bbaf265d44d6a1e1ce;hpb=dc0eacd40b625258355eea866d62188e5aa7ce3b;p=openldap
diff --git a/libraries/librewrite/rewrite.c b/libraries/librewrite/rewrite.c
index b040ee7fd2..372018ac74 100644
--- a/libraries/librewrite/rewrite.c
+++ b/libraries/librewrite/rewrite.c
@@ -1,7 +1,7 @@
/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software .
*
- * Copyright 2000-2005 The OpenLDAP Foundation.
+ * Copyright 2000-2008 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -30,6 +30,7 @@
#include
#include
+#include
#include
int ldap_debug;
@@ -127,7 +128,6 @@ main( int argc, char *argv[] )
FILE *fin = NULL;
char *rewriteContext = REWRITE_DEFAULT_CONTEXT;
int debug = 0;
- char *next;
while ( 1 ) {
int opt = getopt( argc, argv, "d:f:hr:" );
@@ -138,8 +138,7 @@ main( int argc, char *argv[] )
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 );