wrong function used in float parsing

This commit is contained in:
2025-08-20 17:11:39 +02:00
parent 69b9ec2240
commit 0bf6683136

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/20 17:07:58 by tomoron ### ########.fr */ /* Updated: 2025/08/20 17:10:02 by tomoron ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
#include "includes/ft_ping.h" #include "includes/ft_ping.h"
@ -37,7 +37,7 @@ double get_set_float(char *arg, t_settings *set)
float value; float value;
char *end; char *end;
value = strtol(arg, &end, 10); value = strtof(arg, &end);
if(*end) if(*end)
{ {
fprintf(stderr, "%s: invalid value (`%s' near `%s')\n", set->name, arg, end); fprintf(stderr, "%s: invalid value (`%s' near `%s')\n", set->name, arg, end);