Add some missing libc functions: setenv, unsetenv, strdup.
--HG-- branch : dtrg-videocore rename : lang/cem/libcc.ansi/stdlib/getenv.c => lang/cem/libcc.ansi/stdlib/setenv.c rename : lang/cem/libcc.ansi/string/strlen.c => lang/cem/libcc.ansi/string/strdup.c
This commit is contained in:
17
lang/cem/libcc.ansi/string/strdup.c
Normal file
17
lang/cem/libcc.ansi/string/strdup.c
Normal file
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
||||
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
||||
*/
|
||||
/* $Id$ */
|
||||
|
||||
#include <string.h>
|
||||
|
||||
char*
|
||||
strdup(const char *s)
|
||||
{
|
||||
int len = strlen(s);
|
||||
char *p = malloc(len+1);
|
||||
if (p)
|
||||
memcpy(p, s, len+1);
|
||||
return p;
|
||||
}
|
||||
Reference in New Issue
Block a user