repositories
/
TD_C.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
TP 13 exo1: Add LTO and GOLD support to the Makefile build options
[TD_C.git]
/
TP_13
/
exo1
/
lib
/
utils.c
diff --git
a/TP_13/exo1/lib/utils.c
b/TP_13/exo1/lib/utils.c
index c48206fed5be5edc6f7f4eab98eb383f1c1b5545..5139bae1bccf69facf4748275a45c3da141732dd 100644
(file)
--- a/
TP_13/exo1/lib/utils.c
+++ b/
TP_13/exo1/lib/utils.c
@@
-1,6
+1,8
@@
+#include <stdio.h>
+
#include "utils.h"
#include "utils.h"
-void swap_int
_ptr
(int* v1, int* v2) {
+void swap_int(int* v1, int* v2) {
int tmp = *v1;
*v1 = *v2;
*v2 = tmp;
int tmp = *v1;
*v1 = *v2;
*v2 = tmp;
@@
-11,3
+13,11
@@
void swap_ptr(void* v1, void* v2) {
v1 = v2;
v2 = tmp;
}
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);
+ }
+}