tuit

toolbox pour des tui - retour accueil

git clone git://bebou.netlib.re/tuit

Log | Files | Refs |

commit 4d19f80ce3019313cb6c469f094fd4e2cc23b408
parent da225c23ad9d059e0f22afd1fbb260fa481cf5d7
Auteurice: Arthur Pons <arthur.pons@unistra.fr>
Date:   Wed, 11 Jun 2025 15:36:16 +0200

Renommange constante, c'est pas pipe game ici

Diffstat:
Mchoose.c | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/choose.c b/choose.c @@ -3,19 +3,19 @@ /* Le chiffre c'est des octets. Les caractères sont encodés sur un octet chacun ? * Donc si on met 5 la taille max serait 4 caractères ? */ -#define CARD_NAME_SIZE 1000 +#define ELEM_SIZE 1000 int max(int a, int b) { return a > b ? a : b; } int min(int a, int b) { return a < b ? a : b; } int main(int argc, char **argv) { int curelem=0; int count=0; int start=0; - char line[CARD_NAME_SIZE]; + char line[ELEM_SIZE]; char **list; while (fgets(line, sizeof(line), stdin)) { list=realloc(list,(count+1)*sizeof(void*)); - list[count] = malloc(CARD_NAME_SIZE); + list[count] = malloc(ELEM_SIZE); strcpy(list[count], line); count++; }