All pastes #594153 Raw Edit

Stuff

public text v1 · immutable
#594153 ·published 2007-06-28 19:44 UTC
rendered paste body
static size_t memdup(char **dst, void *src, size_t len)
{
    if(len)
	*dst = malloc(len);
    else
	*dst = 0;
    if(!*dst)
	return 0;
    memcpy(*dst, src, len);
    return len;
}

_xcb_map* _xcb_map_new(){
	_xcb_map* list;
	list = malloc(sizeof(_xcb_map));
	if(!list)
		return 0;
	list->head = 0;
	list->tail = &list->head;
	return list;
}