From a6c895de85b8f1d2368515b58b7d02541954a190 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 9 Mar 2005 22:20:40 +0000 Subject: r5717: BUG 2215: horrible code in nmbd_winsproxy.c; gcc folks at redhat claim its in violation of the C spec. It's so horrible I believe them (This used to be commit fa7eb5693314efb14d42a739f8006ddf8d41e9d5) --- source3/nmbd/nmbd_winsproxy.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/source3/nmbd/nmbd_winsproxy.c b/source3/nmbd/nmbd_winsproxy.c index b01ffcffc1..7531972461 100644 --- a/source3/nmbd/nmbd_winsproxy.c +++ b/source3/nmbd/nmbd_winsproxy.c @@ -190,12 +190,15 @@ void make_wins_proxy_name_query_request( struct subnet_record *subrec, struct packet_struct *incoming_packet, struct nmb_name *question_name) { - long *ud[(sizeof(struct userdata_struct) + sizeof(struct subrec *) + - sizeof(struct packet_struct *))/sizeof(long *) + 1]; - struct userdata_struct *userdata = (struct userdata_struct *)ud; + union { + struct userdata_struct ud; + char c[sizeof(struct userdata_struct) + sizeof(struct subrec *) + + sizeof(struct packet_struct *)+sizeof(long*)]; + } ud; + struct userdata_struct *userdata = &ud.ud; unstring qname; - memset(ud, '\0', sizeof(ud)); + memset(&ud, '\0', sizeof(ud)); userdata->copy_fn = wins_proxy_userdata_copy_fn; userdata->free_fn = wins_proxy_userdata_free_fn; -- cgit