summaryrefslogtreecommitdiff
path: root/rushs/tinyprintf/my_c_tail
diff options
context:
space:
mode:
authorMartial Simon <msimon_fr@hotmail.com>2025-10-11 22:19:00 +0200
committerMartial Simon <msimon_fr@hotmail.com>2025-10-11 22:19:00 +0200
commit73c2b00a10c5786ddeeacc915e233fd4df1c9321 (patch)
treee299ea4e8ac161b2b21170172ff8f182c1c3fe1a /rushs/tinyprintf/my_c_tail
parentc9b6b9a5ca082fe7c1b6f58d7713f785a9eb6a5c (diff)
fix: evalexpr & tinyprintf contenaient toute la piscine
Diffstat (limited to 'rushs/tinyprintf/my_c_tail')
-rw-r--r--rushs/tinyprintf/my_c_tail/main.c10
-rw-r--r--rushs/tinyprintf/my_c_tail/my_c_tail.c46
-rw-r--r--rushs/tinyprintf/my_c_tail/my_c_tail.h6
3 files changed, 0 insertions, 62 deletions
diff --git a/rushs/tinyprintf/my_c_tail/main.c b/rushs/tinyprintf/my_c_tail/main.c
deleted file mode 100644
index ba33337..0000000
--- a/rushs/tinyprintf/my_c_tail/main.c
+++ /dev/null
@@ -1,10 +0,0 @@
-#include <stdlib.h>
-
-#include "my_c_tail.h"
-
-int main(int argc, char *argv[])
-{
- if (argc > 1)
- stdintail(atoi(argv[1]));
- return 0;
-}
diff --git a/rushs/tinyprintf/my_c_tail/my_c_tail.c b/rushs/tinyprintf/my_c_tail/my_c_tail.c
deleted file mode 100644
index 790240c..0000000
--- a/rushs/tinyprintf/my_c_tail/my_c_tail.c
+++ /dev/null
@@ -1,46 +0,0 @@
-#include "my_c_tail.h"
-
-#include <stdlib.h>
-#include <unistd.h>
-
-void stdintail(unsigned int n)
-{
- char **lines = calloc(2000, sizeof(char *));
- lines[0] = malloc(350 * sizeof(char));
- size_t m = 0;
- char c;
- size_t i = 0;
- while (read(STDIN_FILENO, &c, 1))
- {
- if (c == '\n')
- {
- lines[m][i] = '\0';
- lines[++m] = malloc(350 * sizeof(char));
- i = 0;
- }
- else
- {
- lines[m][i++] = c;
- }
- }
-
- size_t j;
- if (m > n)
- {
- for (size_t i = 0; i < m - n; i++)
- free(lines[i]);
- j = m - n;
- }
- else
- j = 0;
-
- for (; j < m; j++)
- {
- for (size_t i = 0; lines[j][i]; i++)
- write(STDOUT_FILENO, &(lines[j][i]), 1);
- write(STDOUT_FILENO, "\n", 1);
- free(lines[j]);
- }
- free(lines[m]);
- free(lines);
-}
diff --git a/rushs/tinyprintf/my_c_tail/my_c_tail.h b/rushs/tinyprintf/my_c_tail/my_c_tail.h
deleted file mode 100644
index 172c844..0000000
--- a/rushs/tinyprintf/my_c_tail/my_c_tail.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef MY_C_TAIL_H
-#define MY_C_TAIL_H
-
-void stdintail(unsigned int n);
-
-#endif // MY_C_TAIL_H