TP 13 exo1: Add LTO and GOLD support to the Makefile build options
[TD_C.git] / TP_13 / exo1 / lib / utils.c
index 04a20e4e1ed363eb9d7cd229967423bddd4faf50..5139bae1bccf69facf4748275a45c3da141732dd 100644 (file)
@@ -1,3 +1,5 @@
+#include <stdio.h>
+
 #include "utils.h"
 
 void swap_int(int* v1, int* v2) {
@@ -11,3 +13,11 @@ void swap_ptr(void* v1, void* v2) {
     v1 = v2;
     v2 = tmp;
 }
+
+void handle_prompt_error(int errno) {
+    if (errno != 0) {
+        printf("\nMerci de saisir un nombre entier, exiting\n");
+        /* it's somewhat violent but better than looping forever */
+        exit(EXIT_FAILURE);
+    }
+}