From 35d69c80a609d5533ad2ee0386bcdbc1a1f12443 Mon Sep 17 00:00:00 2001 From: Franklin Wei Date: Wed, 15 Mar 2017 18:27:25 -0400 Subject: [PATCH] Rewrite void* arithmetic cppcheck reported: [chessbox/chessbox_pgn.c:51]: (portability) 'bufptr' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined. Change-Id: Ib2139489fa316fb61b4bcdc08f17b97eb6ad0be7 --- apps/plugins/chessbox/chessbox_pgn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/plugins/chessbox/chessbox_pgn.c b/apps/plugins/chessbox/chessbox_pgn.c index f5f19e2688..4e16834f5c 100644 --- a/apps/plugins/chessbox/chessbox_pgn.c +++ b/apps/plugins/chessbox/chessbox_pgn.c @@ -48,7 +48,7 @@ static void *pl_malloc(size_t size) } else { - bufptr += size; + bufptr = (char*)(bufptr) + size; bufleft -= size; return ptr; }