changed version, polished gtp-start a bit

AuthorKonata <konata@posteo.jp>
Date
Commita2c6327b5659737b9262758a3bb6d3563a6a3122
Parentbeb1713
4 files changed, 7 insertions(+), 4 deletions(-)
Minclude/simple-go/simple-go.h
@@ -15,6 +15,8 @@
1515 #define NO_FIELD '\0'
1616 #define COUNTED '+'
1717
18+#define VERSIONSTR "1.1"
19+
1820 typedef size_t go_coordinate;
1921 typedef char go_symbol;
2022
Msrc/gtp-start.c
@@ -4,12 +4,12 @@
44 int main(int argc, char** argv)
55 {
66 game_state* game = create_game(19, 6.5);
7- char input[50] = {0};
7+ char input[50];
88 char* answer;
99
1010 while(1)
1111 {
12- fgets(input, 49, stdin);
12+ fgets(input, 50, stdin);
1313 if(strcmp(input, "quit\n") == 0)
1414 break;
1515 answer = handle_gtp_cmd(input, game);
@@ -17,5 +17,6 @@ int main(int argc, char** argv)
1717 free(answer);
1818 }
1919
20+ puts("Bye!");
2021 delete_game(game);
2122 }
Msrc/meson.build
@@ -1,4 +1,4 @@
11 src = ['simple-go.c', 'simple-gtp.c', 'simple-gtp-func.c']
22
33 executable('test_go', src + ['test.c'], include_directories : inc, dependencies : cutils_dep, c_args: CFLAGS )
4-executable('gtp-start', src + ['gtp-start.c'], include_directories : inc, dependencies : cutils_dep, c_args: CFLAGS )
4+executable('gtp-start', src + ['gtp-start.c'], include_directories : inc, dependencies : cutils_dep, c_args: CFLAGS, install: true )
Msrc/simple-gtp-func.c
@@ -54,7 +54,7 @@ char* name_func(const Vector* arguments, const char* id, game_state* game)
5454
5555 char* version_func(const Vector* arguments, const char* id, game_state* game)
5656 {
57- return cmd_success("0.1", id);
57+ return cmd_success(VERSIONSTR, id);
5858 }
5959
6060 char* known_command_func(const Vector* arguments, const char* id, game_state* game)