Skip to content

Commit d397cdf

Browse files
committed
fix: remove constant
The `const` directive produced conflict on concat time to `localFilePath`.
1 parent 22d2a16 commit d397cdf

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

src/play/main.c

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88
#include "../structs.h"
99
#include "./utilities.h"
1010

11-
unsigned char playTicTacToe(const Configuration* config, const char* localFilePath) {
12-
unsigned char error;
13-
11+
unsigned char playTicTacToe(const Configuration* config, char* localFilePath) {
1412
List players;
1513
List playersAfterMatch;
1614

@@ -46,17 +44,23 @@ unsigned char playTicTacToe(const Configuration* config, const char* localFilePa
4644
if (!pushElement(&playersAfterMatch, &player, sizeof(player))) return 0;
4745
}
4846

49-
error = postAPI(config, &playersAfterMatch);
47+
if (postAPI(config, &playersAfterMatch)) {
48+
puts("> Error! An error occurred on post to the API.\n\n");
5049

51-
destroyList(&players);
52-
destroyList(&playersAfterMatch);
50+
destroyList(&players);
51+
destroyList(&playersAfterMatch);
5352

54-
if (error) {
55-
puts("> Error! An error occurred on post matches data.");
5653
return 0;
5754
};
5855

59-
createLocalFile(&playersAfterMatch, localFilePath);
56+
if (createLocalRecord(config, &playersAfterMatch, localFilePath)) {
57+
puts("> Error! An error occurred on create local record.\n\n");
58+
59+
destroyList(&players);
60+
destroyList(&playersAfterMatch);
61+
62+
return 0;
63+
};
6064

6165
return 1;
6266
}

src/play/main.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33

44
#include "../configuration/main.h"
55

6-
unsigned char playTicTacToe(const Configuration* config, const char* nameOfTheLocalFile);
6+
unsigned char playTicTacToe(const Configuration* config, char* localFilePath);
77

8-
#endif // SRC__PLAY_H_INCLUDED
8+
#endif // SRC__PLAY_H_INCLUDED

0 commit comments

Comments
 (0)