summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/tools/ldbmodify.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-12-04 10:14:03 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:06:20 -0500
commit9012a501533126c4c0ac25a16fd6439a45df3d9a (patch)
tree24e31070e5b34000a70d78ecbc019c0ff141bde2 /source4/lib/ldb/tools/ldbmodify.c
parent2f9e170f45e128eb6ab6bd97c9c8b40dcd9a97fa (diff)
downloadsamba-9012a501533126c4c0ac25a16fd6439a45df3d9a.tar.gz
samba-9012a501533126c4c0ac25a16fd6439a45df3d9a.tar.bz2
samba-9012a501533126c4c0ac25a16fd6439a45df3d9a.zip
r4059: moved the ldb -o option parsing to a common routine
(This used to be commit ee52c1e38c9bac852458196ffbd677cca62a3965)
Diffstat (limited to 'source4/lib/ldb/tools/ldbmodify.c')
-rw-r--r--source4/lib/ldb/tools/ldbmodify.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/source4/lib/ldb/tools/ldbmodify.c b/source4/lib/ldb/tools/ldbmodify.c
index a660b814da..5fabba57b7 100644
--- a/source4/lib/ldb/tools/ldbmodify.c
+++ b/source4/lib/ldb/tools/ldbmodify.c
@@ -34,6 +34,7 @@
#include "includes.h"
#include "ldb/include/ldb.h"
+#include "ldb/include/ldb_private.h"
static int failures;
@@ -102,18 +103,7 @@ static int process_file(struct ldb_context *ldb, FILE *f)
break;
case 'o':
- ldbopts++;
- if (options == NULL) {
- options = (const char **)malloc(sizeof(char *) * (ldbopts + 1));
- } else {
- options = (const char **)realloc(options, sizeof(char *) * (ldbopts + 1));
- if (options == NULL) {
- fprintf(stderr, "Out of memory!\n");
- exit(-1);
- }
- }
- options[ldbopts - 1] = optarg;
- options[ldbopts] = NULL;
+ options = ldb_options_parse(options, &ldbopts, optarg);
break;
case 'h':