aboutsummaryrefslogtreecommitdiff
path: root/test/functional/fixtures/shell-test.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/fixtures/shell-test.c')
-rw-r--r--test/functional/fixtures/shell-test.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/test/functional/fixtures/shell-test.c b/test/functional/fixtures/shell-test.c
index bd71e7d11b..f3e94a28da 100644
--- a/test/functional/fixtures/shell-test.c
+++ b/test/functional/fixtures/shell-test.c
@@ -1,11 +1,12 @@
+#include <stdbool.h>
+#include <stdint.h>
#include <stdio.h>
#include <string.h>
-#include <stdint.h>
#ifdef _MSC_VER
-#include <Windows.h>
-#define usleep(usecs) Sleep(usecs/1000)
+# include <Windows.h>
+# define usleep(usecs) Sleep(usecs/1000)
#else
-#include <unistd.h>
+# include <unistd.h>
#endif
static void flush_wait(void)
@@ -56,7 +57,7 @@ int main(int argc, char **argv)
if (argc >= 2) {
if (strcmp(argv[1], "-t") == 0) {
if (argc < 3) {
- fprintf(stderr,"Missing prompt text for -t option\n");
+ fprintf(stderr, "Missing prompt text for -t option\n");
return 5;
} else {
fprintf(stderr, "%s $ ", argv[2]);
@@ -107,18 +108,18 @@ int main(int argc, char **argv)
char cmd[100];
int arg;
- while (1) {
+ while (true) {
fprintf(stderr, "interact $ ");
if (fgets(input, sizeof(input), stdin) == NULL) {
break; // EOF
}
- if(1 == sscanf(input, "%99s %d", cmd, &arg)) {
+ if (1 == sscanf(input, "%99s %d", cmd, &arg)) {
arg = 0;
}
if (strcmp(cmd, "exit") == 0) {
- return arg;
+ return arg;
} else {
fprintf(stderr, "command not found: %s\n", cmd);
}