Compare commits
2 commits
e4f19610c1
...
14e05066cc
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
14e05066cc | ||
|
|
67addc4c1c |
2 changed files with 8 additions and 8 deletions
|
|
@ -6,7 +6,7 @@
|
|||
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* 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);}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* 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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue