darwin.c (machopic_non_lazy_ptr_name): Fix off by one errors in memcpy destinations.
2003-10-05 Andrew Pinski <apinski@apple.com> * config/darwin.c (machopic_non_lazy_ptr_name): Fix off by one errors in memcpy destinations. (machopic_stub_name): Likewise. From-SVN: r72132
This commit is contained in:
parent
6691a79e06
commit
ea04c4a331
@ -1,3 +1,8 @@
|
|||||||
|
2003-10-05 Andrew Pinski <apinski@apple.com>
|
||||||
|
* config/darwin.c (machopic_non_lazy_ptr_name): Fix off by one
|
||||||
|
errors in memcpy destinations.
|
||||||
|
(machopic_stub_name): Likewise.
|
||||||
|
|
||||||
2003-10-05 Andrew Pinski <apinski@apple.com>
|
2003-10-05 Andrew Pinski <apinski@apple.com>
|
||||||
|
|
||||||
* config/darwin.c (machopic_non_lazy_ptr_name):
|
* config/darwin.c (machopic_non_lazy_ptr_name):
|
||||||
|
@ -304,17 +304,17 @@ machopic_non_lazy_ptr_name (const char *name)
|
|||||||
bufferlen = 2;
|
bufferlen = 2;
|
||||||
if (name[0] == '*')
|
if (name[0] == '*')
|
||||||
{
|
{
|
||||||
memcpy (buffer+bufferlen, name+1, namelen-1+1);
|
memcpy (buffer + bufferlen +1, name+1, namelen-1+1);
|
||||||
bufferlen += namelen-1;
|
bufferlen += namelen-1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
buffer[bufferlen] = '_';
|
buffer[bufferlen] = '_';
|
||||||
memcpy (buffer+bufferlen+1, name, namelen+1);
|
memcpy (buffer + bufferlen+1 +1, name, namelen+1);
|
||||||
bufferlen += namelen;
|
bufferlen += namelen;
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy (buffer + bufferlen, "$non_lazy_ptr", strlen("$non_lazy_ptr")+1);
|
memcpy (buffer + bufferlen +1, "$non_lazy_ptr", strlen("$non_lazy_ptr")+1);
|
||||||
bufferlen += strlen("$non_lazy_ptr");
|
bufferlen += strlen("$non_lazy_ptr");
|
||||||
ptr_name = get_identifier (buffer);
|
ptr_name = get_identifier (buffer);
|
||||||
|
|
||||||
@ -379,24 +379,24 @@ machopic_stub_name (const char *name)
|
|||||||
|
|
||||||
if (name[0] == '*')
|
if (name[0] == '*')
|
||||||
{
|
{
|
||||||
memcpy (buffer + bufferlen, name+1, namelen - 1 +1);
|
memcpy (buffer + bufferlen +1, name+1, namelen - 1 +1);
|
||||||
bufferlen += namelen - 1;
|
bufferlen += namelen - 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
buffer[bufferlen] = '_';
|
buffer[bufferlen] = '_';
|
||||||
memcpy (buffer + bufferlen +1, name, namelen+1);
|
memcpy (buffer + bufferlen+1 +1, name, namelen+1);
|
||||||
bufferlen += namelen;
|
bufferlen += namelen;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (needs_quotes)
|
if (needs_quotes)
|
||||||
{
|
{
|
||||||
memcpy (buffer + bufferlen, "$stub\"", strlen("$stub\""));
|
memcpy (buffer + bufferlen +1, "$stub\"", strlen("$stub\""));
|
||||||
bufferlen += strlen("$stub\"");
|
bufferlen += strlen("$stub\"");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
memcpy (buffer + bufferlen, "$stub", strlen("$stub"));
|
memcpy (buffer + bufferlen +1, "$stub", strlen("$stub"));
|
||||||
bufferlen += strlen("$stub");
|
bufferlen += strlen("$stub");
|
||||||
}
|
}
|
||||||
ptr_name = get_identifier (buffer);
|
ptr_name = get_identifier (buffer);
|
||||||
|
Loading…
Reference in New Issue
Block a user