mirror of
https://github.com/cc65/cc65.git
synced 2025-01-11 11:30:13 +00:00
ar65: better version of last change
This commit is contained in:
parent
d3c495e8b9
commit
64449f0f54
@ -249,10 +249,8 @@ void LibOpen (const char* Name, int MustExist, int NeedTemp)
|
||||
if (NeedTemp) {
|
||||
|
||||
/* Create the temporary library name */
|
||||
NewLibName = xmalloc (strlen (Name) + strlen (".temp-") + 8 + 1);
|
||||
strcpy (NewLibName, Name);
|
||||
strcat (NewLibName, ".temp-");
|
||||
sprintf (NewLibName + strlen (NewLibName), "%X", (unsigned int)getpid());
|
||||
NewLibName = xmalloc (strlen (Name) + (sizeof (".temp-") - 1) + 2 * sizeof (unsigned int) + 1);
|
||||
sprintf (NewLibName, "%s.temp-%X", Name, (unsigned int)getpid ());
|
||||
|
||||
/* Create the temporary library */
|
||||
NewLib = fopen (NewLibName, "w+b");
|
||||
|
Loading…
x
Reference in New Issue
Block a user