recode functions to shrink size

This commit is contained in:
Mike Frysinger
2005-06-11 00:08:50 +00:00
parent 942e137679
commit 85cffcc83d
9 changed files with 92 additions and 109 deletions

View File

@@ -23,17 +23,17 @@ const char *os_tab[] =
*/
char *e2p_os2string(int os_type)
{
const char *os;
char *ret;
const char *os;
char *ret;
if (os_type <= EXT2_OS_LITES)
os = os_tab[os_type];
else
os = "(unknown os)";
ret = malloc(strlen(os)+1);
strcpy(ret, os);
return ret;
ret = xmalloc(strlen(os)+1);
strcpy(ret, os);
return ret;
}
/*
@@ -41,8 +41,8 @@ char *e2p_os2string(int os_type)
*/
int e2p_string2os(char *str)
{
const char **cpp;
int i = 0;
const char **cpp;
int i = 0;
for (cpp = os_tab; *cpp; cpp++, i++) {
if (!strcasecmp(str, *cpp))