File tree Expand file tree Collapse file tree 2 files changed +15
-11
lines changed Expand file tree Collapse file tree 2 files changed +15
-11
lines changed Original file line number Diff line number Diff line change 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}
Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments