1. 12
  1.  

  2. 2
    var state = 0
    […]
    while (state > 0 && …) {
    

    Umm.

    1. 3

      Good catch! That should be a >=, but the equals seems to have been lost while I was editing the markdown file, since my IDE project retains it. I’ve updated the post to fix this, now.

    2. 1

      Agreed, Legacy code with State Machine Logic is usually very obsfuscated.