summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2005-03-09 22:20:40 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:55:56 -0500
commita6c895de85b8f1d2368515b58b7d02541954a190 (patch)
tree6f49e28cf61084c9047a456bd184779b35d9d399
parent779191f26066934773b00e1ba55df635e5c6851e (diff)
downloadsamba-a6c895de85b8f1d2368515b58b7d02541954a190.tar.gz
samba-a6c895de85b8f1d2368515b58b7d02541954a190.tar.bz2
samba-a6c895de85b8f1d2368515b58b7d02541954a190.zip
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)
-rw-r--r--source3/nmbd/nmbd_winsproxy.c11
1 files 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;