From 826c2f926952ed7bdf77099da36750900d08fd11 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 17 Nov 2000 00:31:29 +0000 Subject: Fix for incorrect break using wrong offset when updating a form. Jeremy. (This used to be commit 365c76e39d2397a12ac6785a51c4d1529527a356) --- source3/printing/nt_printing.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'source3/printing') diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c index 895e3c6b05..34d9538752 100644 --- a/source3/printing/nt_printing.c +++ b/source3/printing/nt_printing.c @@ -163,17 +163,15 @@ BOOL add_a_form(nt_forms_struct **list, const FORM *form, int *count) update=False; unistr2_to_ascii(form_name, &form->name, sizeof(form_name)-1); - for (n=0; n<*count && update==False; n++) - { - if (!strncmp((*list)[n].name, form_name, strlen(form_name))) - { + for (n=0; n<*count; n++) { + if (!strncmp((*list)[n].name, form_name, strlen(form_name))) { DEBUG(103, ("NT workaround, [%s] already exists\n", form_name)); update=True; + break; } } - if (update==False) - { + if (update==False) { if((*list=Realloc(*list, (n+1)*sizeof(nt_forms_struct))) == NULL) return False; unistr2_to_ascii((*list)[n].name, &form->name, sizeof((*list)[n].name)-1); -- cgit