mirror of
https://github.com/UberGames/lilium-voyager.git
synced 2024-12-14 14:11:15 +00:00
strdup still not accepted by some systems. *sigh*.
This commit is contained in:
parent
a2715bc283
commit
1d2d67cdde
1 changed files with 5 additions and 2 deletions
|
@ -241,11 +241,14 @@ static void hash_add_label(const char* label, unsigned address)
|
||||||
{
|
{
|
||||||
struct hashentry* h;
|
struct hashentry* h;
|
||||||
unsigned i = hashkey(label, -1U);
|
unsigned i = hashkey(label, -1U);
|
||||||
|
int labellen;
|
||||||
|
|
||||||
i %= sizeof(labelhash)/sizeof(labelhash[0]);
|
i %= sizeof(labelhash)/sizeof(labelhash[0]);
|
||||||
h = malloc(sizeof(struct hashentry));
|
h = malloc(sizeof(struct hashentry));
|
||||||
|
|
||||||
h->label = strdup(label);
|
labellen = strlen(label) + 1;
|
||||||
|
h->label = malloc(labellen);
|
||||||
|
memcpy(h->label, label, labellen);
|
||||||
|
|
||||||
h->address = address;
|
h->address = address;
|
||||||
h->next = labelhash[i];
|
h->next = labelhash[i];
|
||||||
|
|
Loading…
Reference in a new issue