mirror of
https://github.com/cc65/cc65.git
synced 2024-12-27 15:29:46 +00:00
Recoded the last change
git-svn-id: svn://svn.cc65.org/cc65/trunk@3368 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
8cd583d591
commit
5b0ad76cd9
@ -479,12 +479,12 @@ static void O65RelocPutByte (O65RelocTab* R, unsigned B)
|
|||||||
/* Do we have enough space in the buffer? */
|
/* Do we have enough space in the buffer? */
|
||||||
if (R->Fill == R->Size) {
|
if (R->Fill == R->Size) {
|
||||||
/* We need to grow the buffer */
|
/* We need to grow the buffer */
|
||||||
unsigned NewSize = (R->Size == 0)? 1024 : R->Size * 2;
|
if (R->Size) {
|
||||||
unsigned char* NewBuf = xmalloc (NewSize);
|
R->Size *= 2;
|
||||||
memcpy (NewBuf, R->Buf, R->Size);
|
} else {
|
||||||
xfree (R->Buf);
|
R->Size = 1024; /* Initial size */
|
||||||
R->Size = NewSize;
|
}
|
||||||
R->Buf = NewBuf;
|
R->Buf = xrealloc (R->Buf, R->Size);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Put the byte into the buffer */
|
/* Put the byte into the buffer */
|
||||||
|
Loading…
Reference in New Issue
Block a user