rcs2git.c:latin1_alpha(): make the argument int
commit90ff2a45698efd7e45f38a00495bfe04b94a812c
authorRoman Kagan <rkagan@sw.ru>
Thu, 21 Jun 2007 00:23:50 +0000 (21 01:23 +0100)
committerKeith Packard <keithp@neko.keithp.com>
Thu, 21 Jun 2007 00:23:50 +0000 (21 01:23 +0100)
treef1e8387785f43f9c8f801dd87609d27ae82424ce
parent300e89513354d336dc78e25bc6b85608663d5c97
rcs2git.c:latin1_alpha(): make the argument int

latin1_alpha() is declared as taking unsigned char; however, it is actually
given an int type argument which can, in particular, be EOF == (int) -1.  EOF
is then converted to (unsigned char) 255 which latin1_alpha() happily accepts
as valid.

As a result, the inner loop in expandline() for KDELIM case, where keyword is
consumed from the input, doesn't stop on EOF.  Therefore in the (corner) case
where the CVS file ends in $smth with no newline, on output we get
$smth\xff\xff\xff\xff (i.e. filled with \xff up to KEYLENGTH == 8 characters
after the $).

Declaring latin1_alpha() as taking int fixes the problem.
rcs2git.c