[mISDNuser PATCH 1/3] Fix wrong argument to sizeof() call inside memset()

Thomas Jarosch <[email protected]>
Newsgroups gmane.linux.isdn.i4l.user
Organization Intra2net AG
Message-ID <[email protected]>
We were passing the pointer size instead of the structure size.

cppcheck reported:
[bridge/bridge.c:547]: (warning) Using size of pointer mISDNport instead of size of its data.

Signed-off-by: Thomas Jarosch <[email protected]>
---
 bridge/Makefile.in |    7 ++++---
 bridge/bridge.c    |    2 +-
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/bridge/bridge.c b/bridge/bridge.c
index 7d92ea3..0306cd8 100644
--- a/bridge/bridge.c
+++ b/bridge/bridge.c
@@ -544,7 +544,7 @@ struct mISDNport *mISDN_port_open(int port, int nt_mode, int hdlc)
 		fprintf(stderr, "Cannot alloc mISDNport structure\n");
 		return(NULL);
 	}
-	memset(mISDNport, 0, sizeof(mISDNport));
+	memset(mISDNport, 0, sizeof(struct mISDNport));
 	*mISDNportp = mISDNport;
 	mISDNport->prev = mISDNport_prev;
 
-- 
1.7.4.4

_______________________________________________
isdn4linux mailing list
[email protected]
https://www.isdn4linux.de/mailman/listinfo/isdn4linux
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.