diff options
author | Andrew Tridgell <tridge@samba.org> | 2000-05-27 03:37:05 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2000-05-27 03:37:05 +0000 |
commit | b6ecd4fbe29fe44e229c6e9ec38c51b67f53825b (patch) | |
tree | f947759517b2e0af59a9d6f98ae3b590e56c50ab | |
parent | afab6492e1297737366573cdd9d1483320c30b3f (diff) | |
download | samba-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)
-rw-r--r-- | source3/printing/nt_printing.c | 8 |
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) |