[openEuler-5.10-LTS 411/501] tools/thermal: Fix possible path truncations