0
0
mirror of https://github.com/zeromq/libzmq.git synced 2024-12-27 15:41:05 +08:00

Fix pointer indirection precedence issue in docs

Without this change, a segmentation fault is likely to occur when using the proposed snippet of code, as `*address[size]` is equivalent to `*(address[size])`, not `(*address)[size]` as clearly intended.
This commit is contained in:
Elliot Saba 2015-09-13 20:46:14 -07:00
parent 2c94bb42c5
commit 1fbc67a40a

View File

@ -150,7 +150,7 @@ get_monitor_event (void *monitor, int *value, char **address)
size_t size = zmq_msg_size (&msg);
*address = (char *) malloc (size + 1);
memcpy (*address, data, size);
*address [size] = 0;
(*address)[size] = 0;
}
return event;
}