summaryrefslogtreecommitdiff
path: root/source3/printing
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2000-05-27 03:37:05 +0000
committerAndrew Tridgell <tridge@samba.org>2000-05-27 03:37:05 +0000
commitb6ecd4fbe29fe44e229c6e9ec38c51b67f53825b (patch)
treef947759517b2e0af59a9d6f98ae3b590e56c50ab /source3/printing
parentafab6492e1297737366573cdd9d1483320c30b3f (diff)
downloadsamba-b6ecd4fbe29fe44e229c6e9ec38c51b67f53825b.tar.gz
samba-b6ecd4fbe29fe44e229c6e9ec38c51b67f53825b.tar.bz2
samba-b6ecd4fbe29fe44e229c6e9ec38c51b67f53825b.zip
fixed call of firstkey/nextkey to traverse driver database
(This used to be commit 11010f946af4d60d88bed450692e43c6a7860ab7)
Diffstat (limited to 'source3/printing')
-rw-r--r--source3/printing/nt_printing.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c
index 56b6a4c570..90271333e8 100644
--- a/source3/printing/nt_printing.c
+++ b/source3/printing/nt_printing.c
@@ -62,14 +62,14 @@ get a form struct list
****************************************************************************/
int get_ntforms(nt_forms_struct **list)
{
- TDB_DATA kbuf, dbuf;
+ TDB_DATA kbuf, newkey, dbuf;
nt_forms_struct form;
int ret;
int n = 0;
for (kbuf = tdb_firstkey(tdb);
kbuf.dptr;
- free(kbuf.dptr), kbuf = tdb_nextkey(tdb, kbuf)) {
+ newkey = tdb_nextkey(tdb, kbuf), free(kbuf.dptr), kbuf=newkey) {
if (strncmp(kbuf.dptr, FORMS_PREFIX, strlen(FORMS_PREFIX)) != 0) continue;
dbuf = tdb_fetch(tdb, kbuf);
@@ -201,14 +201,14 @@ int get_ntdrivers(fstring **list, char *architecture)
int total=0;
fstring short_archi;
pstring key;
- TDB_DATA kbuf;
+ TDB_DATA kbuf, newkey;
get_short_archi(short_archi, architecture);
slprintf(key, sizeof(key), "%s/%s/", DRIVERS_PREFIX, short_archi);
for (kbuf = tdb_firstkey(tdb);
kbuf.dptr;
- free(kbuf.dptr), kbuf = tdb_nextkey(tdb, kbuf)) {
+ newkey = tdb_nextkey(tdb, kbuf), free(kbuf.dptr), kbuf=newkey) {
if (strncmp(kbuf.dptr, key, strlen(key)) != 0) continue;
if((*list = Realloc(*list, sizeof(fstring)*(total+1))) == NULL)