From 344273a7e0a6899451836e6072fecebea4a6ac24 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Wed, 10 Dec 2014 02:58:25 +0100 Subject: add xmemdup macro MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/mds-kbdc/raw-data.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/mds-kbdc/raw-data.c') diff --git a/src/mds-kbdc/raw-data.c b/src/mds-kbdc/raw-data.c index cf48486..d8976ec 100644 --- a/src/mds-kbdc/raw-data.c +++ b/src/mds-kbdc/raw-data.c @@ -408,8 +408,7 @@ int read_source_lines(const char* restrict pathname, mds_kbdc_source_code_t* res } /* Simplify file. */ - fail_if (xmalloc(real_content, content_size, char)); - memcpy(real_content, content, content_size * sizeof(char)); + fail_if (xmemdup(real_content, content, content_size, char)); real_content_size = content_size; content_size = remove_comments(content, content_size); fail_if (xxrealloc(old, content, content_size, char)); -- cgit v1.2.3-70-g09d2