Commit 1fbc67a4 authored by Elliot Saba's avatar Elliot Saba

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.
parent 2c94bb42
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment