forked from github/server
remove bsdstring from battle.
This commit is contained in:
parent
455a929d9e
commit
396e0f6bd7
1 changed files with 7 additions and 11 deletions
18
src/battle.c
18
src/battle.c
|
@ -64,7 +64,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
#include <util/assert.h>
|
#include <util/assert.h>
|
||||||
#include <util/attrib.h>
|
#include <util/attrib.h>
|
||||||
#include <util/base36.h>
|
#include <util/base36.h>
|
||||||
#include <util/bsdstring.h>
|
|
||||||
#include <util/language.h>
|
#include <util/language.h>
|
||||||
#include <util/lists.h>
|
#include <util/lists.h>
|
||||||
#include <util/log.h>
|
#include <util/log.h>
|
||||||
|
@ -3517,10 +3516,10 @@ static int battle_report(battle * b)
|
||||||
for (bf = b->factions; bf; bf = bf->next) {
|
for (bf = b->factions; bf; bf = bf->next) {
|
||||||
faction *fac = bf->faction;
|
faction *fac = bf->faction;
|
||||||
char buf[32 * MAXSIDES];
|
char buf[32 * MAXSIDES];
|
||||||
char *bufp = buf;
|
|
||||||
size_t size = sizeof(buf) - 1;
|
|
||||||
message *m;
|
message *m;
|
||||||
|
sbstring sbs;
|
||||||
|
|
||||||
|
sbs_init(&sbs, buf, sizeof(buf));
|
||||||
battle_message_faction(b, fac, msg_separator);
|
battle_message_faction(b, fac, msg_separator);
|
||||||
|
|
||||||
if (cont)
|
if (cont)
|
||||||
|
@ -3540,24 +3539,22 @@ static int battle_report(battle * b)
|
||||||
char buffer[32];
|
char buffer[32];
|
||||||
|
|
||||||
if (komma) {
|
if (komma) {
|
||||||
bufp = STRLCPY(bufp, ", ", size);
|
sbs_strcat(&sbs, ", ");
|
||||||
}
|
}
|
||||||
snprintf(buffer, sizeof(buffer), "%s %2d(%s): ",
|
snprintf(buffer, sizeof(buffer), "%s %2d(%s): ",
|
||||||
loc_army, army_index(s), abbrev);
|
loc_army, army_index(s), abbrev);
|
||||||
|
sbs_strcat(&sbs, buffer);
|
||||||
bufp = STRLCPY(bufp, buffer, size);
|
|
||||||
|
|
||||||
for (r = FIGHT_ROW; r != NUMROWS; ++r) {
|
for (r = FIGHT_ROW; r != NUMROWS; ++r) {
|
||||||
if (alive[r]) {
|
if (alive[r]) {
|
||||||
if (l != FIGHT_ROW) {
|
if (l != FIGHT_ROW) {
|
||||||
bufp = STRLCPY(bufp, "+", size);
|
sbs_strcat(&sbs, "+");
|
||||||
}
|
}
|
||||||
while (k--) {
|
while (k--) {
|
||||||
bufp = STRLCPY(bufp, "0+", size);
|
sbs_strcat(&sbs, "0+");
|
||||||
}
|
}
|
||||||
sprintf(buffer, "%d", alive[r]);
|
sprintf(buffer, "%d", alive[r]);
|
||||||
|
sbs_strcat(&sbs, buffer);
|
||||||
bufp = STRLCPY(bufp, buffer, size);
|
|
||||||
|
|
||||||
k = 0;
|
k = 0;
|
||||||
l = r + 1;
|
l = r + 1;
|
||||||
|
@ -3569,7 +3566,6 @@ static int battle_report(battle * b)
|
||||||
komma = true;
|
komma = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*bufp = 0;
|
|
||||||
fbattlerecord(b, fac, buf);
|
fbattlerecord(b, fac, buf);
|
||||||
}
|
}
|
||||||
return cont;
|
return cont;
|
||||||
|
|
Loading…
Reference in a new issue