Although with my simpler mind I would prefer the following test line :
(it does maybe need cnt to be +1)
p.s. My compiler seems to prefer c to be an int for the printf statements....
p.p.s. Does the original "design" intend the stray '0' at the start of the column?