From 7ab25a7ae1eea978998cc9ccfd9596b7add33a8b Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Tue, 7 Dec 2004 19:00:45 +0000 Subject: [PATCH] r4089: fix logic error in add_a_form() that only compared N characters instead of the entire form name (This used to be commit e3decbc441686486903a4863daa862ed1672e405) --- source3/printing/nt_printing.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c index b17ddb51caf..3ffedcf1858 100644 --- a/source3/printing/nt_printing.c +++ b/source3/printing/nt_printing.c @@ -593,8 +593,7 @@ BOOL add_a_form(nt_forms_struct **list, const FORM *form, int *count) unistr2_to_ascii(form_name, &form->name, sizeof(form_name)-1); 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)); + if ( strequal((*list)[n].name, form_name) ) { update=True; break; } @@ -618,6 +617,9 @@ BOOL add_a_form(nt_forms_struct **list, const FORM *form, int *count) (*list)[n].right=form->right; (*list)[n].bottom=form->bottom; + DEBUG(6,("add_a_form: Successfully %s form [%s]\n", + update ? "updated" : "added", form_name)); + return True; } -- 2.34.1