MCPcopy Create free account
hub / github.com/Meituan-Dianping/SQLAdvisor / ListCopy

Function ListCopy

dbug/dbug.c:1639–1658  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1637 */
1638
1639static struct link *ListCopy(struct link *orig)
1640{
1641 struct link *new_malloc;
1642 struct link *head;
1643 size_t len;
1644
1645 head= NULL;
1646 while (orig != NULL)
1647 {
1648 len= strlen(orig->str);
1649 new_malloc= (struct link *) DbugMalloc(sizeof(struct link)+len);
1650 memcpy(new_malloc->str, orig->str, len);
1651 new_malloc->str[len]= 0;
1652 new_malloc->flags=orig->flags;
1653 new_malloc->next_link= head;
1654 head= new_malloc;
1655 orig= orig->next_link;
1656 }
1657 return head;
1658}
1659
1660/*
1661 * FUNCTION

Callers 1

DbugParseFunction · 0.85

Calls 1

DbugMallocFunction · 0.85

Tested by

no test coverage detected