fix a bug in cs.c introduced in the last port between branches