o New memory function: strallocandcopy
authorecalot <ecalot>
Sun, 14 Dec 2003 18:12:49 +0000 (18:12 +0000)
committerecalot <ecalot>
Sun, 14 Dec 2003 18:12:49 +0000 (18:12 +0000)
PR/src/lib/layers/memory.c [new file with mode: 0644]

diff --git a/PR/src/lib/layers/memory.c b/PR/src/lib/layers/memory.c
new file mode 100644 (file)
index 0000000..67a8bb1
--- /dev/null
@@ -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;
+}