From 2bb6b24251c41181e513130fe45d41ba6a379cb1 Mon Sep 17 00:00:00 2001 From: "flyingscorpio@arch-desktop" Date: Sun, 14 Nov 2021 23:32:27 +0100 Subject: [PATCH] Fix overflow in fgets --- programmation-c-cpp/tp3/creation-mot-de-passe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/programmation-c-cpp/tp3/creation-mot-de-passe.c b/programmation-c-cpp/tp3/creation-mot-de-passe.c index 3da72e4..e64eab1 100644 --- a/programmation-c-cpp/tp3/creation-mot-de-passe.c +++ b/programmation-c-cpp/tp3/creation-mot-de-passe.c @@ -41,7 +41,7 @@ int main() { void creer_mot_de_passe(char *mot_de_passe) { int i = 0; - fgets(mot_de_passe, 101, stdin); + fgets(mot_de_passe, 100, stdin); while (mot_de_passe[i] != '\n') i++; mot_de_passe[i] = '\0'; }