1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-25 13:29:41 +00:00

Fixed a bug: Never remember a pointer to a string buffer, since it becomes

invalid when the string buffer gets resized.


git-svn-id: svn://svn.cc65.org/cc65/trunk@5268 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
uz 2011-08-23 18:04:25 +00:00
parent d225866449
commit 262ed5db8b

View File

@ -54,7 +54,7 @@ void GT_AddArray (StrBuf* Type, unsigned ArraySize)
unsigned SizeBytes;
/* Remember the current position */
char* A = SB_GetBuf (Type) + SB_GetLen (Type);
unsigned Pos = SB_GetLen (Type);
/* Add a dummy array token */
SB_AppendChar (Type, GT_TYPE_ARRAY);
@ -68,7 +68,7 @@ void GT_AddArray (StrBuf* Type, unsigned ArraySize)
} while (ArraySize);
/* Write the correct array token */
*A = GT_ARRAY (SizeBytes);
SB_GetBuf (Type)[Pos] = GT_ARRAY (SizeBytes);
}