summaryrefslogtreecommitdiff
path: root/os/oscolor.c
diff options
context:
space:
mode:
authorDaniel Stone <daniel@fooishbar.org>2007-11-05 14:03:26 +0000
committerDaniel Stone <daniel@fooishbar.org>2007-11-05 14:34:41 +0000
commit2761c103311a1160bc483fd0367d654733df8598 (patch)
tree6b721e79d384904c927af364c83aad82099ee4a1 /os/oscolor.c
parent2d738efb959912d8a89864e41190e0064fa77906 (diff)
OS: Remove usage of alloca
Replace with heap allocations.
Diffstat (limited to 'os/oscolor.c')
-rw-r--r--os/oscolor.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/os/oscolor.c b/os/oscolor.c
index e1756926d..6f3a7fa4a 100644
--- a/os/oscolor.c
+++ b/os/oscolor.c
@@ -180,7 +180,7 @@ lookup(char *name, int len, Bool create)
dbEntryPtr entry, *prev = NULL;
char *str = name;
- if (!(name = (char*)ALLOCATE_LOCAL(len +1))) return NULL;
+ if (!(name = (char*)xalloc(len +1))) return NULL;
CopyISOLatin1Lowered((unsigned char *)name, (unsigned char *)str, len);
name[len] = '\0';
@@ -206,7 +206,7 @@ lookup(char *name, int len, Bool create)
strcpy( entry->name, name );
}
- DEALLOCATE_LOCAL(name);
+ xfree(name);
return entry;
}
@@ -225,13 +225,13 @@ OsInitColors(void)
if (!was_here)
{
- path = (char*)ALLOCATE_LOCAL(strlen(rgbPath) +5);
+ path = (char*)xalloc(strlen(rgbPath) +5);
strcpy(path, rgbPath);
strcat(path, ".txt");
if (!(rgb = fopen(path, "r")))
{
ErrorF( "Couldn't open RGB_DB '%s'\n", rgbPath );
- DEALLOCATE_LOCAL(path);
+ xfree(path);
return FALSE;
}
@@ -259,7 +259,7 @@ OsInitColors(void)
}
fclose(rgb);
- DEALLOCATE_LOCAL(path);
+ xfree(path);
was_here = TRUE;
}