Check system() return value
This commit is contained in:
parent
cd9b330a1f
commit
b1b2e1c521
9
sd.c
9
sd.c
|
@ -1,6 +1,7 @@
|
|||
#include <assert.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
|
@ -56,8 +57,8 @@ int main(int argc, char* argv[]) {
|
|||
}
|
||||
|
||||
/* Disable input buffering */
|
||||
system("stty -F /dev/tty cbreak min 1");
|
||||
system("stty -F /dev/tty -echo");
|
||||
assert(system("stty -F /dev/tty cbreak min 1") == 0);
|
||||
assert(system("stty -F /dev/tty -echo") == 0);
|
||||
|
||||
while (true) {
|
||||
int x = (long long)rand() * rand() % seg[1];
|
||||
|
@ -100,6 +101,6 @@ int main(int argc, char* argv[]) {
|
|||
}
|
||||
|
||||
/* Cleanup */
|
||||
system("stty -F /dev/tty echo");
|
||||
sqlite3_close(db);
|
||||
assert(system("stty -F /dev/tty echo") == 0);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue