Remove hardcoded size values

Use sizeof() macro instead of hardcoded size values in various parts of
the code.

Signed-off-by: Sebastien GODARD <sysstat@orange.fr.fake>