From 67addc4c1cd1fdf7f2018844972e3ccbdaa3d3ad Mon Sep 17 00:00:00 2001 From: Raphael Date: Mon, 30 Mar 2026 19:20:49 +0200 Subject: [PATCH 1/2] style(includes): adding a tabulation to the macro --- includes/macro.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/macro.h b/includes/macro.h index cdd2318..ad42623 100644 --- a/includes/macro.h +++ b/includes/macro.h @@ -6,7 +6,7 @@ /* By: rparodi +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2026/03/24 11:23:47 by rparodi #+# #+# */ -/* Updated: 2026/03/30 12:29:28 by rparodi ### ########.fr */ +/* Updated: 2026/03/30 19:18:54 by rparodi ### ########.fr */ /* */ /* ************************************************************************** */ @@ -19,8 +19,8 @@ # define DEBUG 0 #endif -#define ERROR_LOG(str) if (DEBUG) {dprintf(2, "%sError:\t%s (%s:%d in %s)%s\n", CLR_RED, str, __FILE_NAME__, __LINE__, __FUNCTION__, CLR_RESET);} else { dprintf(2, "%s\n", str); } +#define ERROR_LOG(str) if (DEBUG) {dprintf(2, "%sError:\t\t%s (%s:%d in %s)%s\n", CLR_RED, str, __FILE_NAME__, __LINE__, __FUNCTION__, CLR_RESET);} else { dprintf(2, "%s\n", str); } #define WARN_LOG(str) if (DEBUG) {dprintf(2, "%sWarning:\t%s (%s:%d in %s)%s\n", CLR_YELLOW, str, __FILE_NAME__, __LINE__, __FUNCTION__, CLR_RESET);} -#define INFO_LOG(str) if (DEBUG) {dprintf(2, "%sInfo:\t%s (%s:%d in %s)%s\n", CLR_BLUE, str, __FILE_NAME__, __LINE__, __FUNCTION__, CLR_RESET);} -#define DEBUG_LOG(str) if (DEBUG) {dprintf(2, "%sDebug:\t%s (%s:%d in %s)%s\n", CLR_GREY, str, __FILE_NAME__, __LINE__, __FUNCTION__, CLR_RESET);} +#define INFO_LOG(str) if (DEBUG) {dprintf(2, "%sInfo:\t\t%s (%s:%d in %s)%s\n", CLR_BLUE, str, __FILE_NAME__, __LINE__, __FUNCTION__, CLR_RESET);} +#define DEBUG_LOG(str) if (DEBUG) {dprintf(2, "%sDebug:\t\t%s (%s:%d in %s)%s\n", CLR_GREY, str, __FILE_NAME__, __LINE__, __FUNCTION__, CLR_RESET);} #define SUCCESS_LOG(str) if (DEBUG) {dprintf(2, "%sSuccess:\t%s (%s:%d in %s)%s\n", CLR_GREEN, str, __FILE_NAME__, __LINE__, __FUNCTION__, CLR_RESET);} From 14e05066ccab2c17dea5fc80a17d1d7c99eb7b9c Mon Sep 17 00:00:00 2001 From: Raphael Date: Mon, 30 Mar 2026 19:20:56 +0200 Subject: [PATCH 2/2] style(parsing/sources): using the same error message for empty args - This message is the same of the ping command (inetutils 2.0). --- parsing/sources/parsing.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/parsing/sources/parsing.c b/parsing/sources/parsing.c index 0ae2467..d8a4b1c 100644 --- a/parsing/sources/parsing.c +++ b/parsing/sources/parsing.c @@ -6,7 +6,7 @@ /* By: rparodi +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2026/03/23 14:49:36 by rparodi #+# #+# */ -/* Updated: 2026/03/30 15:53:23 by rparodi ### ########.fr */ +/* Updated: 2026/03/30 19:07:53 by rparodi ### ########.fr */ /* */ /* ************************************************************************** */ @@ -29,8 +29,8 @@ static char *_find_target(int argc, char **argv) { } } - if (target == NULL || target[0] == '\0') { - ERROR_LOG("ft_ping: missing host operand \n Try 'ft_ping --help' or 'ft_ping --usage' for more information."); + if (target == NULL) { + ERROR_LOG("ft_ping: missing host operand\nTry 'ft_ping --help' or 'ft_ping --usage' for more information."); exit(64); } @@ -40,7 +40,7 @@ static char *_find_target(int argc, char **argv) { void parsing_args(int argc, char **argv, t_flags *flags) { if (argc == 1) { - ERROR_LOG("ft_ping: missing host operand \n Try 'ft_ping --help' or 'ft_ping --usage' for more information."); + ERROR_LOG("ft_ping: missing host operand\nTry 'ft_ping --help' or 'ft_ping --usage' for more information."); exit(64); }