error when linger is negative

This commit is contained in:
2025-08-24 20:02:51 +02:00
parent 6f6e41477b
commit 6f0e4a18ce

View File

@ -6,7 +6,7 @@
/* By: tomoron <tomoron@student.42angouleme.fr> +#+ +:+ +#+ */ /* By: tomoron <tomoron@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2025/04/26 17:01:53 by tomoron #+# #+# */ /* Created: 2025/04/26 17:01:53 by tomoron #+# #+# */
/* Updated: 2025/08/24 19:53:30 by tomoron ### ########.fr */ /* Updated: 2025/08/24 20:02:16 by tomoron ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
#include "includes/ft_ping.h" #include "includes/ft_ping.h"
@ -74,6 +74,11 @@ int check_values(t_settings *set, char *name)
fprintf(stderr, "%s: option value is too small: %g\n", name, set->interval); fprintf(stderr, "%s: option value is too small: %g\n", name, set->interval);
return(0); return(0);
} }
if(set->linger < 0)
{
fprintf(stderr, "%s: option value too big : %d\n", name, set->linger);
return(0);
}
return (1); return (1);
} }