diff options
author | Bardur Arantsson <bardur@scientician.net> | 2010-01-08 22:50:54 +0100 |
---|---|---|
committer | Bardur Arantsson <bardur@scientician.net> | 2010-01-08 23:46:24 +0100 |
commit | 838abd31d2041bff1a42767ec92ad7452cb9ce74 (patch) | |
tree | bfd8390a990ee9fcd33bd2ed89019dd18f9fabfa /src | |
parent | 99ac98d498de7ce634dc7f798da7f19a5235f836 (diff) |
Import fix from CVS: Avoid using strcpy(). Fixes loading/saving on Linux distributions using Fortify in libc.
Diffstat (limited to 'src')
-rw-r--r-- | src/loadsave.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/loadsave.c b/src/loadsave.c index f77a5a9f..adc13c6e 100644 --- a/src/loadsave.c +++ b/src/loadsave.c @@ -237,16 +237,16 @@ static void do_subrace(int flag) char buf[81]; if (flag == LS_SAVE) - strcpy(buf, sr_ptr->title + rmp_name); + strncpy(buf, sr_ptr->title + rmp_name, 80); do_string(buf, 80, flag); if (flag == LS_LOAD) - strcpy(sr_ptr->title + rmp_name, buf); + strncpy(sr_ptr->title + rmp_name, buf, 80); if (flag == LS_SAVE) - strcpy(buf, sr_ptr->desc + rmp_text); + strncpy(buf, sr_ptr->desc + rmp_text, 80); do_string(buf, 80, flag); if (flag == LS_LOAD) - strcpy(sr_ptr->desc + rmp_text, buf); + strncpy(sr_ptr->desc + rmp_text, buf, 80); do_byte((byte*)&sr_ptr->place, flag); |