Removes some undefined behavior. Signed-off by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>