[PATCH] s3/lib/netapi/tests/netuser.c: fix wrong closing paren

Michael Adam obnox at samba.org
Thu Feb 25 16:36:55 UTC 2016


On 2016-02-25 at 17:30 +0100, Michael Adam wrote:
> On 2016-02-25 at 16:57 +0100, Michael Adam wrote:
> > On 2016-02-25 at 16:26 +0100, David Disseldorp wrote:
> > > On Thu, 25 Feb 2016 15:52:49 +0100, Aurélien Aptel wrote:
> > > 
> > > > Hi,
> > > > 
> > > > This patch fixes a typo in a netuser test.
> > > > 
> > > > Please review&push
> > > 
> > > Good catch, looks obviously correct to me.
> > > Reviewed-by: David Disseldorp <ddiss at samba.org>
> > 
> > Obvious goodness. Pushing.
> 
> Oops, almost obvious goodness:
> 
> gcc pointed out to me that we probably want sizeof(*u0) instead
> of sizeof(u0) - right?
> 
> >> [3443/4165] Compiling source3/lib/netapi/tests/netuser.c
> >> ../source3/lib/netapi/tests/netuser.c: In function ‘test_netusermodals’:
> >> ../source3/lib/netapi/tests/netuser.c:247:28: error: argument to ‘sizeof’ in ‘memcmp’ call is the same expression as the first source; did you mean to dereference it? [-Werror=sizeof-pointer-memaccess]
> >>   if (memcmp(u0, _u0, sizeof(u0)) != 0) {
> >>                             ^
> >> compilation terminated due to -Wfatal-errors.
> 
> 
> I'd push with that change to the patch...
> If you two sign-off on that.

Ok, to make things a little more concrete, here is the modified
patch. Feel free to push, David, if you approve.
-------------- next part --------------
From 0c59add6e047e94b7bc1c6af5018aa3c59a2a116 Mon Sep 17 00:00:00 2001
From: Aurelien Aptel <aaptel at suse.com>
Date: Thu, 25 Feb 2016 14:17:46 +0100
Subject: [PATCH] s3/lib/netapi/tests/netuser.c: fix wrong closing paren

Signed-off-by: Aurelien Aptel <aaptel at suse.com>
Reviewed-by: David Disseldorp <ddiss at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
---
 source3/lib/netapi/tests/netuser.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/source3/lib/netapi/tests/netuser.c b/source3/lib/netapi/tests/netuser.c
index beeeb34..de5f0a1 100644
--- a/source3/lib/netapi/tests/netuser.c
+++ b/source3/lib/netapi/tests/netuser.c
@@ -244,7 +244,7 @@ static NET_API_STATUS test_netusermodals(struct libnetapi_ctx *ctx,
 		return status;
 	}
 
-	if (memcmp(u0, _u0, sizeof(u0) != 0)) {
+	if (memcmp(u0, _u0, sizeof(*u0)) != 0) {
 		printf("USER_MODALS_INFO_0 struct has changed!!!!\n");
 		return -1;
 	}
-- 
2.5.0

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20160225/8080f4b9/signature.sig>


More information about the samba-technical mailing list