fix some C static code analysis warnings