In the following bash session you can see the ((cnt++))
sets the exit code to 1 if cnt is zero, but not if the initial value is anything else, why is this?
$ cnt=0
$ echo $?
0
$ ((cnt++))
$ echo $?
1
$ echo $cnt
1
$ ((cnt++))
$ echo $?
0
$ echo $cnt
2