The performance of the LHCf detector for hadronic showers