summaryrefslogtreecommitdiff
path: root/src/libelfu/modelops/clone.c
diff options
context:
space:
mode:
authornorly <ny-git@enpas.org>2013-06-21 00:41:14 +0100
committernorly <ny-git@enpas.org>2013-06-21 00:42:22 +0100
commit272d88460cae164fe310ba905c58e1834eb4eecd (patch)
treec6590895be53bbe4c8f51c12e396adb46cecdbdf /src/libelfu/modelops/clone.c
parente68a6c6cc16279c72e270daae0548ea7c0f11c6e (diff)
Merge cloneScn() into reladd.c
It's the only place where we use it, and it's case-specific
Diffstat (limited to 'src/libelfu/modelops/clone.c')
-rw-r--r--src/libelfu/modelops/clone.c35
1 files changed, 0 insertions, 35 deletions
diff --git a/src/libelfu/modelops/clone.c b/src/libelfu/modelops/clone.c
deleted file mode 100644
index 8b9b0bc..0000000
--- a/src/libelfu/modelops/clone.c
+++ /dev/null
@@ -1,35 +0,0 @@
-#include <assert.h>
-#include <stdlib.h>
-#include <string.h>
-#include <libelfu/libelfu.h>
-
-ElfuScn* elfu_mCloneScn(ElfuScn *ms)
-{
- ElfuScn *newscn;
-
- assert(ms);
-
- newscn = elfu_mScnAlloc();
- if (!newscn) {
- ELFU_WARN("elfu_nCloneScn: Could not allocate memory for new ElfuScn.\n");
- return NULL;
- }
-
- newscn->shdr = ms->shdr;
-
- if (ms->databuf) {
- void *newbuf = malloc(ms->shdr.sh_size);
- if (!newbuf) {
- ELFU_WARN("elfu_nCloneScn: Could not allocate memory for new data buffer.\n");
- free(newscn);
- return NULL;
- }
-
- memcpy(newbuf, ms->databuf, ms->shdr.sh_size);
- newscn->databuf = newbuf;
- }
-
- newscn->oldptr = ms;
-
- return newscn;
-}