git » fp-git.git » commit ae7e8fc

o New memory function: strallocandcopy

author ecalot
2003-12-14 18:12:49 UTC
committer ecalot
2003-12-14 18:12:49 UTC
parent bc6f4dd36aee17dc654ed478326dbf6fdf63070a

o New memory function: strallocandcopy

PR/src/lib/layers/memory.c +11 -0

diff --git a/PR/src/lib/layers/memory.c b/PR/src/lib/layers/memory.c
new file mode 100644
index 0000000..67a8bb1
--- /dev/null
+++ b/PR/src/lib/layers/memory.c
@@ -0,0 +1,11 @@
+#include "memory.h"
+
+char* strallocandcopy(const char* text) {
+	int size;
+	char* aux;
+	if (text==NULL) return NULL;
+	size=strlen(text)+1;
+	aux=getMemory(size);
+	if (aux) memcpy(aux,text,size);
+	return aux;
+}