Use BUF_MAX instead of LINE_MAX.