Warning digit1 may be used uninitialized in this function

Don't know. And I can't test compile the code here to investigate.