aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ext2fs/tdbtool.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ext2fs/tdbtool.c')
-rw-r--r--lib/ext2fs/tdbtool.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/lib/ext2fs/tdbtool.c b/lib/ext2fs/tdbtool.c
index 0366cdac..130fc588 100644
--- a/lib/ext2fs/tdbtool.c
+++ b/lib/ext2fs/tdbtool.c
@@ -1,4 +1,4 @@
-/*
+/*
Unix SMB/CIFS implementation.
Samba database functions
Copyright (C) Andrew Tridgell 1999-2000
@@ -10,12 +10,12 @@
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 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., 675 Mass Ave, Cambridge, MA 02139, USA.
@@ -130,7 +130,7 @@ static void print_data(const char *buf,int len)
printf("%02X ",(int)buf[i]);
i++;
if (i%8 == 0) printf(" ");
- if (i%16 == 0) {
+ if (i%16 == 0) {
print_asc(&buf[i-16],8); printf(" ");
print_asc(&buf[i-8],8); printf("\n");
if (i<len) printf("[%03X] ",i);
@@ -138,18 +138,18 @@ static void print_data(const char *buf,int len)
}
if (i%16) {
int n;
-
+
n = 16 - (i%16);
printf(" ");
if (n>8) printf(" ");
while (n--) printf(" ");
-
+
n = i%16;
if (n > 8) n = 8;
print_asc(&buf[i-(i%16)],n); printf(" ");
n = (i%16) - n;
- if (n>0) print_asc(&buf[i-n],n);
- printf("\n");
+ if (n>0) print_asc(&buf[i-n],n);
+ printf("\n");
}
}
@@ -171,7 +171,7 @@ static void help(void)
" delete key : delete a record by key\n"
" list : print the database hash table and freelist\n"
" free : print the database freelist\n"
-" ! command : execute system command\n"
+" ! command : execute system command\n"
" 1 | first : print the first record\n"
" n | next : print the next record\n"
" q | quit : terminate\n"
@@ -266,11 +266,11 @@ static void show_tdb(char *keyname, size_t keylen)
terror("fetch failed");
return;
}
-
+
print_rec(tdb, key, dbuf, NULL);
-
+
free( dbuf.dptr );
-
+
return;
}
@@ -314,23 +314,23 @@ static void move_rec(char *keyname, size_t keylen, char* tdbname)
terror("fetch failed");
return;
}
-
+
print_rec(tdb, key, dbuf, NULL);
-
+
dst_tdb = tdb_open(tdbname, 0, 0, O_RDWR, 0600);
if ( !dst_tdb ) {
terror("unable to open destination tdb");
return;
}
-
+
if ( tdb_store( dst_tdb, key, dbuf, TDB_REPLACE ) == -1 ) {
terror("failed to move record");
}
else
printf("record moved\n");
-
+
tdb_close( dst_tdb );
-
+
return;
}
@@ -399,7 +399,7 @@ static void first_record(TDB_CONTEXT *the_tdb, TDB_DATA *pkey)
{
TDB_DATA dbuf;
*pkey = tdb_firstkey(the_tdb);
-
+
dbuf = tdb_fetch(the_tdb, *pkey);
if (!dbuf.dptr) terror("fetch failed");
else {
@@ -411,9 +411,9 @@ static void next_record(TDB_CONTEXT *the_tdb, TDB_DATA *pkey)
{
TDB_DATA dbuf;
*pkey = tdb_nextkey(the_tdb, *pkey);
-
+
dbuf = tdb_fetch(the_tdb, *pkey);
- if (!dbuf.dptr)
+ if (!dbuf.dptr)
terror("fetch failed");
else
print_rec(the_tdb, *pkey, dbuf, NULL);
@@ -536,7 +536,7 @@ static char *convert_string(char *instring, size_t *sizep)
size_t length = 0;
char *outp, *inp;
char temp[3];
-
+
outp = inp = instring;