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
This commit is contained in:
Franklin Wei 2017-03-15 18:27:25 -04:00
parent 8628c60469
commit 35d69c80a6

View file

@ -48,7 +48,7 @@ static void *pl_malloc(size_t size)
}
else
{
bufptr += size;
bufptr = (char*)(bufptr) + size;
bufleft -= size;
return ptr;
}