[PATCH] missing typecast in database.c