Shouldn't this assignment be in  the same place as numOfBufferOverrun?  If it means code is duplicated you could add a clearBufferOverrun() function.