In xtoi(), limit the scope of the variable d2.