Commit graph

41 commits

Author SHA1 Message Date
0b66d8e281 Plug FILE leak on show_first_tel() error paths
Leak introduced in commit 4238323d, v4.3.20.  Unlikely to bite in
practice, as only corrupt mailbox files can cause these errors.
2011-12-29 11:47:05 +01:00
7e2008e7f4 License upgrade to GPL version 3 or later
Why upgrade?  I'm not a lawyer, but here's my take on the differences
to version 2:

* Software patents: better protection against abuse of patents to
  prevent users from exercising the rights under the GPL.  I doubt
  we'll get hit with a patent suit, but it's a good move just on
  general principles.

* License compatibility: compatible with more free licenses, i.e. can
  "steal" more free software for use in Empire.  I don't expect to steal
  much, but it's nice to have the option.

* Definition of "source code": modernization of some details for today's
  networked world, to make it easier to distribute the software.  Not
  really relevant to us now, as we normally distribute full source code.

* Tivoization: this is about putting GPL-licensed software in hardware,
  then make the hardware refuse to run modified software.  "Neat" trick
  to effectively deny its users their rights under the GPL.  Abuse was
  "pioneered" by TiVo (popular digital video recorders).  GPLv3 forbids
  it.  Unlikely to become a problem for us.

* Internationalization: more careful wording, to harden the license
  outside the US.  The lawyers tell us it better be done that way.

* License violations: friendlier way to deal with license violations.
  This has come out of past experience enforcing the GPL.

* Additional permissions: Probably not relevant to us.

Also include myself in the list of principal authors.
2011-04-12 21:20:58 +02:00
73e25ff21e Update copyright notice 2010-01-19 08:40:17 +01:00
6ae4eca045 Don't use 0 as null pointer constant, part 3
This part replaces E == 0 by !E, where E has pointer type.
2009-03-24 21:46:01 +01:00
ee20a9cd34 Update known contributors comments 2009-02-18 21:11:33 +01:00
e8926559d1 Move show_first_tel() from player.c to rea.c 2009-02-08 14:21:15 +01:00
4238323d63 Factor out code to read mailboxes, and make read more robust
New tel_read_header(), tel_read_body().  Use them in rea(),
show_first_tel(), copy_and_expire().

rea() now stops when it encounters a corrupt telegram, and logs the
problem.  Before, error detection was incomplete, and errors were not
logged.  Corrupt mailboxes could make it crash.

show_first_tel() and copy_and_expire() can now cope with telegrams of
arbitrary length, like rea(), and sanity-check the header fields they
don't actually use.
2009-02-08 14:21:15 +01:00
4c81ca34cb Make struct telstr members tel_type and tel_length unsigned
They are simpler to use that way.
2009-02-08 14:21:15 +01:00
35ef345ecb Update copyright notice 2009-02-08 09:33:18 +01:00
d702068457 Fix trailing whitespace 2008-09-17 21:31:40 -04:00
db02dda32f Update copyright notice 2008-01-19 10:15:37 +01:00
Ron Koenderink
5299580260 (posix_fileno) [_WIN32]: Rename posix_fileno() to fileno().
Remove the extern posix_fileno().

(fileno) [_WIN32]: Replace system fileno() with a function that supports posix
file descriptors.  Move #undef fileno to w32misc.h as the system define
is in stdio.h.

(rea) [_WIN32]: Add stdio.h for fileno() extern declaration and add misc.h
to ensure the WIN32 fixes to stdio.h are included.
2007-08-24 21:05:59 +00:00
63bdc89835 Update copyright notice. 2007-01-09 19:09:31 +00:00
e42053d928 Break inclusion cycle: prototypes.h and commands.h included each
other.  Ensure headers in include/ can be included in any order
(except for econfig-spec.h, which is special).  New header types.h to
help avoid inclusion cycles.  Sort include directives.  Remove some
superflous includes.
2006-07-10 06:37:23 +00:00
e28851b8e9 Normalize unsigned int to just unsigned. 2006-04-30 12:26:07 +00:00
45ad6a8e71 (rea): Simplify. 2006-04-30 08:38:06 +00:00
a988b907fc s_char purge directed by compiler warnings. 2006-04-29 06:41:45 +00:00
8cd3845b08 Remove useless multiplications with sizeof(char) and sizeof(s_char).
Replace by literal 1 in other contexts.
2006-03-26 10:16:08 +00:00
4515b84c59 COPYING duplicates information from README. Remove. Move GPL from
LICENSE to COPYING, because that's where it usually is.  Update all
the references to these files.
2006-01-21 19:48:41 +00:00
604fe007c0 (acce, rea, rela, snxtitem): Pass NULL as prompt when the prompt won't
be used.
2006-01-06 21:37:40 +00:00
3e400c018c Update copyright notice. 2006-01-05 13:36:57 +00:00
3aebb68ee7 Include config.h. 2005-12-27 18:04:19 +00:00
71e164ed30 Document, in particular use of UTF-8. Simplify code in a couple of
places, but no functional changes.
2005-06-13 19:02:49 +00:00
cb454a1f56 (rea, turn): Use a different buffer for message text. Just for
clarity.
2005-06-12 10:11:04 +00:00
4f59fc9967 Remove a bunch of redundant casts. 2005-06-12 06:31:48 +00:00
ee6d72f3b8 (rea): Portability fix. 2005-06-12 05:25:28 +00:00
Ron Koenderink
2cc44bb182 Support UTF-8 encoded Unicode for user communications.
(NF_UTF8, togg): New client flag.
(flash, wall): User text input filtering.
(parse, prmptrd): Normal text input filtering.
(uprmptrd, ugetstring): New, to get user text.
(getele, flash, wall): Use them.
(getele): No need to filter out funny characters; input filtering
takes care of them.
(sendmessage, ufindbreak): Work on user text.
(uprnf): New, to print user text.
(rea, gamedown, show_motd): Use it.
(prnf): Unused, remove.
(pr, upr_player): Normal text output filtering (with highlighting).
(pr_flash): User text output filtering.
2005-05-26 01:58:48 +00:00
Ron Koenderink
92ac36ec56 (rea): Set parameters for read to [yes|no|<CNUM/CNAME>].
Add parameters for read in the command list and the info pages.
Closes #1010010.
2005-03-25 21:04:39 +00:00
345ad3dfe0 Update copyright notice. 2005-03-16 22:03:16 +00:00
Ron Koenderink
55e6aca9e0 (wrmakesrc,wripglob,wrgamesdef,info,apro,mobupdate,rea,turn
upda,ef_open,logerror,emp_config,match_user,show_motd,gamedown,
typed_wu,delete_old_announcements,mobility_check,mobility_init,
allocate_memory,write_newcap_script,main,files,fairland,doconfig,)
[_WIN32]: Switchback to default mode of text.
"t" (text) is not included the ISO/ANSI C standard but "b" (binary)
is included.
2005-03-02 12:47:15 +00:00
Ron Koenderink
9b56e4d5a0 (rea): Add brackets to prevent 'else' ambiguity. 2004-12-31 14:12:34 +00:00
Ron Koenderink
cc1a92e512 (rea): Code cleanup. 2004-12-30 01:43:39 +00:00
Ron Koenderink
1a8488bc45 (main,mobility_check,upda,turn,rea,mobupdate,ef_open,logerror,
emp_config,gamedown,show_motd,match_user,typed_wu,
delete_old_announcements) [_WIN32]: switch the default file mode to
binary to match POSIX.  Remove the now unneccessary ifdef for
the open/fopen. Add text mode for user files (econfig/auth).
2004-12-30 01:31:03 +00:00
fac342ed49 Update copyright notice. 2004-09-07 15:07:16 +00:00
f6d7ebb480 (rea): Don't use L_SET, it's ancient BSD history, just use SEEK_SET. 2004-02-29 11:35:38 +00:00
c1be5d8657 Don't declare things in more than one place. Move some declarations
between headers.  Code is now fully prototyped and compiles cleanly
with gcc -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs
-Wredundant-decls.  Closes #723788.
2004-02-20 20:45:18 +00:00
46da1aec7a deity.h is redundant, remove it. 2004-02-20 20:34:43 +00:00
c8bb4d9b87 (effadv_list, effadv, rejects, rejectname, telnames, rea, numnames,
tennames, numstr): Replace by static local variables in their only
user.
(relates): Move from global/misc.c to common/nat.c.
(att_mode): Move from global/misc.c to subs/attsub.c.
2004-02-19 19:14:29 +00:00
4ae9c417b3 (bzero, bcopy): Obsolete BSDisms; remove. Remove some calls without
effect.  Replace calls by struct assignment where possible.  Replace
clear buffer, copy string to buffer by strncpy().  Use assignment to
clear when that's clearer.  Replace overlapping copy through bounce
buffer by memmove().  Replace rest by standard memset() and memcpy().
Also use sizeof() instead of literal array sizes for robustness, and
instead of symbolic array sizes for clarity.
2004-01-08 17:54:28 +00:00
9b7adfbecc Indented with src/scripts/indent-emp. 2003-09-02 20:48:48 +00:00
d8b7fdfae1 Import of Empire 4.2.12 2003-08-23 12:23:04 +00:00