mirror of
				https://github.com/zeromq/libzmq.git
				synced 2025-11-04 04:10:00 +01: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:
		@@ -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;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user