diff options
author | Markus Uhlin <markus@nifty-networks.net> | 2024-05-04 16:32:32 +0200 |
---|---|---|
committer | Markus Uhlin <markus@nifty-networks.net> | 2024-05-04 16:32:32 +0200 |
commit | 456d39aa3f9273761afbc7aa1d1843e5b9b88c84 (patch) | |
tree | 9a82aac69e263c56957277f919d0094bca565a14 /FICS | |
parent | 9c305113ed9e6b1ee47521d92b9b3b7ee81cf8d5 (diff) |
Reformatted functions
Diffstat (limited to 'FICS')
-rw-r--r-- | FICS/gamedb.c | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/FICS/gamedb.c b/FICS/gamedb.c index 8f538e1..1a49c48 100644 --- a/FICS/gamedb.c +++ b/FICS/gamedb.c @@ -166,25 +166,31 @@ PUBLIC int game_finish(int g) return 0; } -PUBLIC void MakeFENpos (int g, char *FEN) +PUBLIC void +MakeFENpos(int g, char *FEN) { - strcpy(FEN, boardToFEN(g)); + strcpy(FEN, boardToFEN(g)); } -PUBLIC char *game_time_str(int wt, int winc, int bt, int binc) +PUBLIC char * +game_time_str(int wt, int winc, int bt, int binc) { - static char tstr[50]; + static char tstr[50] = { '\0' }; - if ((!wt) && (!winc)) { /* Untimed */ - strcpy(tstr, ""); - return tstr; - } - if ((wt == bt) && (winc == binc)) { - sprintf(tstr, " %d %d", wt, winc); - } else { - sprintf(tstr, " %d %d : %d %d", wt, winc, bt, binc); - } - return tstr; + if ((!wt) && (!winc)) { // Untimed + strcpy(tstr, ""); + return tstr; + } + + if ((wt == bt) && (winc == binc)) { + msnprintf(tstr, sizeof tstr, " %d %d", wt, winc); + } else { + msnprintf(tstr, sizeof tstr, " %d %d : %d %d", + wt, winc, + bt, binc); + } + + return tstr; } PUBLIC char * |