cell_strdup(): fix for inline egcs

pull/893/head
nick black 4 years ago committed by Nick Black
parent 3681939e38
commit fb8efe03e0

@ -664,9 +664,9 @@ static inline char*
cell_strdup(const struct ncplane* n, const cell* c){
char* ret;
if(cell_simple_p(c)){
if( (ret = (char*)malloc(2)) ){ // cast is here for C++ clients
ret[0] = c->gcluster;
ret[1] = '\0';
if( (ret = (char*)malloc(sizeof(c->gcluster) + 1)) ){ // cast is here for C++ clients
memset(ret, 0, sizeof(c->gcluster) + 1);
memcpy(ret, &c->gcluster, sizeof(c->gcluster));
}
}else{
ret = strdup(cell_extended_gcluster(n, c));

Loading…
Cancel
Save