From 4742d7872802ff7b2fbcd6a39f4d9704ca0ba74b Mon Sep 17 00:00:00 2001 From: jekwupeter <31484984+jekwupeter@users.noreply.github.com> Date: Mon, 20 Jun 2022 08:13:48 +0100 Subject: [PATCH 1/3] Added dash to custom getline --- monty.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monty.h b/monty.h index 41de8fd..1626858 100644 --- a/monty.h +++ b/monty.h @@ -34,7 +34,7 @@ typedef struct instruction_s void (*f)(stack_t **stack, unsigned int line_number); } instruction_t; -size_t getline(char **lineptr, size_t *n, FILE *stream); +size_t _getline(char **lineptr, size_t *n, FILE *stream); void pall(stack_t **stack_ptr, unsigned int count __attribute__((unused))); size_t print_dlistint(const stack_t *stack_ptr); int delete_dnodeint(stack_t **stack_ptr, unsigned int count); From 8678c747f8dd8e31e02641c0aca7f02c806ab825 Mon Sep 17 00:00:00 2001 From: jekwupeter <31484984+jekwupeter@users.noreply.github.com> Date: Mon, 20 Jun 2022 08:14:45 +0100 Subject: [PATCH 2/3] Added underscore to customer getline function --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.c b/main.c index 4d4c08f..ea402e1 100644 --- a/main.c +++ b/main.c @@ -29,7 +29,7 @@ int main(int argc, char *argv[]) exit(EXIT_FAILURE); } - while ((read = getline(&line, &len, fp)) != -1) + while ((read = _getline(&line, &len, fp)) != -1) { if (*line == '\n') { From 66a2afa2c8e460730ee3b256eac18d8a17cc134b Mon Sep 17 00:00:00 2001 From: jekwupeter Date: Mon, 20 Jun 2022 12:37:57 +0100 Subject: [PATCH 3/3] added underscore to the getline fcuntion name --- main.c | 2 +- monty.exe | Bin 132403 -> 132403 bytes monty.h | 2 +- other_functions.c | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) diff --git a/main.c b/main.c index 4d4c08f..ea402e1 100644 --- a/main.c +++ b/main.c @@ -29,7 +29,7 @@ int main(int argc, char *argv[]) exit(EXIT_FAILURE); } - while ((read = getline(&line, &len, fp)) != -1) + while ((read = _getline(&line, &len, fp)) != -1) { if (*line == '\n') { diff --git a/monty.exe b/monty.exe index e626a7fab1c74e80d2aecf269cf14024d1368df8..ca59b9a2d08730311e13339f2577a6a26b69d6ff 100644 GIT binary patch delta 47 zcmV+~0MP%liU_lc2#|;a#apnEi%kNeS%KQM+5wV@3SVbsbZlvEWl#~9z^MTux0s3n Fn|k@M6s7Y-w&~08kN^z^MTux0s3n Fn|j^g6R`jQ diff --git a/monty.h b/monty.h index 41de8fd..1626858 100644 --- a/monty.h +++ b/monty.h @@ -34,7 +34,7 @@ typedef struct instruction_s void (*f)(stack_t **stack, unsigned int line_number); } instruction_t; -size_t getline(char **lineptr, size_t *n, FILE *stream); +size_t _getline(char **lineptr, size_t *n, FILE *stream); void pall(stack_t **stack_ptr, unsigned int count __attribute__((unused))); size_t print_dlistint(const stack_t *stack_ptr); int delete_dnodeint(stack_t **stack_ptr, unsigned int count); diff --git a/other_functions.c b/other_functions.c index 6c60899..a7fdacb 100644 --- a/other_functions.c +++ b/other_functions.c @@ -9,7 +9,7 @@ * Return: returns the number of char entered * * */ -size_t getline(char **lineptr, size_t *n, FILE *stream) { +size_t _getline(char **lineptr, size_t *n, FILE *stream) { char *bufptr = NULL; char *p = bufptr; size_t size;