wmem_list: Fix Dead Store (Dead assignement/Dead increment) Warning found by Clang
[metze/wireshark/wip.git] / epan / wmem / wmem_miscutl.c
1 /* wmem_miscutl.c
2  * Wireshark Memory Manager Misc Utilities
3  * Copyright 2013, Evan Huus <eapache@gmail.com>
4  *
5  * Wireshark - Network traffic analyzer
6  * By Gerald Combs <gerald@wireshark.org>
7  * Copyright 1998 Gerald Combs
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License along
20  * with this program; if not, write to the Free Software Foundation, Inc.,
21  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22  */
23
24 #include <string.h>
25 #include <glib.h>
26
27 #include "wmem_core.h"
28 #include "wmem_miscutl.h"
29
30 void *
31 wmem_memdup(wmem_allocator_t *allocator, const void *source, const size_t size)
32 {
33     void *dest;
34
35     dest = wmem_alloc(allocator, size);
36     memcpy(dest, source, size);
37
38     return dest;
39 }
40
41 /*
42  * Editor modelines  -  http://www.wireshark.org/tools/modelines.html
43  *
44  * Local variables:
45  * c-basic-offset: 4
46  * tab-width: 8
47  * indent-tabs-mode: nil
48  * End:
49  *
50  * vi: set shiftwidth=4 tabstop=8 expandtab:
51  * :indentSize=4:tabSize=8:noTabs=true:
52  */