Skip to content

Commit ddfc677

Browse files
committed
Fix ows_geobbox_copy() to use correct sizeof()
The function should do a sizeof() of the structure, and not a pointer to the structure. Raised by GCC 4.8 src/ows/ows_geobbox.c: In function ‘ows_geobbox_copy’: src/ows/ows_geobbox.c:62:29: warning: argument to ‘sizeof’ in ‘memcpy’ call is the same pointer type ‘struct ows_geobbox *’ as the destination; expected ‘ows_geobbox’ or an explicit length [-Wsizeof-pointer-memaccess] return memcpy(c, g, sizeof(g));
1 parent a8a29e0 commit ddfc677

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ows/ows_geobbox.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ ows_geobbox *ows_geobbox_copy(ows_geobbox *g)
5858
ows_geobbox *c;
5959

6060
assert(g);
61-
c = malloc(sizeof(g));
62-
return memcpy(c, g, sizeof(g));
61+
c = malloc(sizeof(*g));
62+
return memcpy(c, g, sizeof(*g));
6363
}
6464

6565

0 commit comments

Comments
 (0)