#include "libft.h" long ft_atol(const char *str) { long long result = ft_atoll(str); // clamp to long range if (result > LONG_MAX) return LONG_MAX; if (result < LONG_MIN) return LONG_MIN; return (long)result; }