summaryrefslogtreecommitdiff
path: root/source3/printing
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2000-11-17 00:31:29 +0000
committerJeremy Allison <jra@samba.org>2000-11-17 00:31:29 +0000
commit826c2f926952ed7bdf77099da36750900d08fd11 (patch)
tree164317e9c50e5c0b49b693acf20ee8ff8cef66a1 /source3/printing
parent7c8e73e9435a740836acbbe677837bc9c3c63b1b (diff)
downloadsamba-826c2f926952ed7bdf77099da36750900d08fd11.tar.gz
samba-826c2f926952ed7bdf77099da36750900d08fd11.tar.bz2
samba-826c2f926952ed7bdf77099da36750900d08fd11.zip
Fix for incorrect break using wrong offset when updating a form.
Jeremy. (This used to be commit 365c76e39d2397a12ac6785a51c4d1529527a356)
Diffstat (limited to 'source3/printing')
-rw-r--r--source3/printing/nt_printing.c10
1 files changed, 4 insertions, 6 deletions
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);