fdt: Add a function to count strings