From 42cfffae80480eae4381902fff3f7c61f858a933 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 7 Dec 2007 17:32:32 -0800 Subject: Remove next_token - all uses must now be next_token_talloc. No more temptations to use static length strings. Jeremy. (This used to be commit ec003f39369910dee852b7cafb883ddaa321c2de) --- source3/nmbd/nmbd_synclists.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'source3/nmbd/nmbd_synclists.c') diff --git a/source3/nmbd/nmbd_synclists.c b/source3/nmbd/nmbd_synclists.c index 8abf60c8ce..147df68a69 100644 --- a/source3/nmbd/nmbd_synclists.c +++ b/source3/nmbd/nmbd_synclists.c @@ -201,7 +201,7 @@ done: Handle one line from a completed sync file. **********************************************************************/ -static void complete_one(struct sync_record *s, +static void complete_one(struct sync_record *s, char *sname, uint32 stype, char *comment) { struct work_record *work; @@ -258,9 +258,10 @@ static void complete_one(struct sync_record *s, static void complete_sync(struct sync_record *s) { XFILE *f; - unstring server, type_str; + char *server; + char *type_str; unsigned type; - fstring comment; + char *comment; char line[1024]; const char *ptr; int count=0; @@ -271,15 +272,18 @@ static void complete_sync(struct sync_record *s) return; while (!x_feof(f)) { + TALLOC_CTX *frame = NULL; if (!fgets_slash(line,sizeof(line),f)) continue; ptr = line; - if (!next_token(&ptr,server,NULL,sizeof(server)) || - !next_token(&ptr,type_str,NULL, sizeof(type_str)) || - !next_token(&ptr,comment,NULL, sizeof(comment))) { + frame = talloc_stackframe(); + if (!next_token_talloc(frame,&ptr,&server,NULL) || + !next_token_talloc(frame,&ptr,&type_str,NULL) || + !next_token_talloc(frame,&ptr,&comment,NULL)) { + TALLOC_FREE(frame); continue; } @@ -288,8 +292,8 @@ static void complete_sync(struct sync_record *s) complete_one(s, server, type, comment); count++; + TALLOC_FREE(frame); } - x_fclose(f); unlink(s->fname); -- cgit