[openEuler-5.10 406/496] tools/thermal: Fix possible path truncations