save
This commit is contained in:
12
lib/str_dup.c
Normal file
12
lib/str_dup.c
Normal file
@@ -0,0 +1,12 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "xmem.h"
|
||||
|
||||
#include "str_dup.h"
|
||||
|
||||
char *str_dup(char *s)
|
||||
{
|
||||
char *new = xmalloc(strlen(s) + 1);
|
||||
strcpy(new, s);
|
||||
return new;
|
||||
}
|
||||
Reference in New Issue
Block a user