diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 1992e5c..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "files.associations": { - "unistd.h": "c" - } -} \ No newline at end of file diff --git a/pendu b/pendu deleted file mode 100755 index e9aae90..0000000 Binary files a/pendu and /dev/null differ diff --git a/pendu.c b/pendu.c index 1231cbb..4586fda 100644 --- a/pendu.c +++ b/pendu.c @@ -37,9 +37,13 @@ void display_hangman(int tries) { } } +/* this function display time out when user does nothing during 30s and verify signal*/ void sig_handler(int signum){ - printf("\ntime out\n"); - exit (1); + if (signum == SIGALRM){ + + printf("\ntime out\n"); + exit (1); + } } int main() {