Avoid use of atoi in malloc