[OPENGLCFG] general.c: Fix overruns and warnings, improve code consistency (#1923)