[Freeciv-Dev] patch: safer string handling: server (PR#220)
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
This is another mostly straightforward but tedious patch
to do safer string operations, this time for server/*.c.
Similar comments apply as regarding common/*.c;
this requires the sz_strlcpy()/sz_strlcat() patch from
previous post.
Notable parts of patch:
- pick_ai_player_name() did lots of unnecessary string copies, so
I re-wrote it; while doing so I changed it to try more random
names, before resorting to sequential.
- added field "sz_svalue" in struct settings_s (stdinhand.c),
as addition of demography means the string values do not all
have the same size available.
Minor code fixes:
- sprintf with "non-format" string -> strlcpy;
- explicit malloc+strcpy -> mystrdup;
- removed some unnecessary intermediate string buffers.
-- David
safe_str_server.diff.gz
Description: GNU Zip compressed data
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Freeciv-Dev] patch: safer string handling: server (PR#220),
David Pfitzner <=
|
|