forked from github/server
less of the "static buffer" warnings in travelthrough-reports
This commit is contained in:
parent
1ebe955bbe
commit
9a037e2433
1 changed files with 16 additions and 4 deletions
|
@ -1262,19 +1262,31 @@ durchreisende(FILE * F, const region * r, const faction * f)
|
|||
} else {
|
||||
bytes = (int)strlcpy(bufp, "die ", size);
|
||||
}
|
||||
if (wrptr(&bufp, &size, bytes)!=0) WARN_STATIC_BUFFER();
|
||||
if (wrptr(&bufp, &size, bytes)!=0) {
|
||||
WARN_STATIC_BUFFER();
|
||||
break;
|
||||
}
|
||||
bytes = (int)strlcpy(bufp, shipname(u->ship), size);
|
||||
} else {
|
||||
bytes = (int)strlcpy(bufp, unitname(u), size);
|
||||
}
|
||||
if (wrptr(&bufp, &size, bytes)!=0) WARN_STATIC_BUFFER();
|
||||
if (wrptr(&bufp, &size, bytes)!=0) {
|
||||
WARN_STATIC_BUFFER();
|
||||
break;
|
||||
}
|
||||
|
||||
if (counter + 1 < maxtravel) {
|
||||
bytes = (int)strlcpy(bufp, ", ", size);
|
||||
if (wrptr(&bufp, &size, bytes)!=0) WARN_STATIC_BUFFER();
|
||||
if (wrptr(&bufp, &size, bytes)!=0) {
|
||||
WARN_STATIC_BUFFER();
|
||||
break;
|
||||
}
|
||||
} else if (counter + 1 == maxtravel) {
|
||||
bytes = (int)strlcpy(bufp, LOC(f->locale, "list_and"), size);
|
||||
if (wrptr(&bufp, &size, bytes)!=0) WARN_STATIC_BUFFER();
|
||||
if (wrptr(&bufp, &size, bytes)!=0) {
|
||||
WARN_STATIC_BUFFER();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue