This is the mail archive of the
cygwin-patches@cygwin.com
mailing list for the Cygwin project.
Re: [PATCH] cygutils:conv.c: Prevent truncation of file if 0xFF is encountered
- From: "Chris January" <chris at atomice dot net>
- To: <cygwin-patches at cygwin dot com>
- Date: Mon, 15 Apr 2002 21:49:17 +0100
- Subject: Re: [PATCH] cygutils:conv.c: Prevent truncation of file if 0xFF is encountered
- References: <1653605153.20020415220043@gmx.net>
> Hello ;)
>
> Today a colleague of mine was struck by a bug of dos2unix/unix2dos
> utilities i.e. if the code encounters 0xFF in the file being processed
> it erronously thinks that this is the EOF and stops processing. The
> result is that the original file is truncated to the position of the
> 0xFF character.
>
> As to why we have such characters in source file - our mother language
> is bulgarian and we sometimes still type comments in it :)
>
> A patch is attached to fix this behaviour.
Hmm... Try this patch instead:
--- conv.c.bak Mon Apr 15 21:47:34 2002
+++ conv.c Mon Apr 15 21:48:03 2002
@@ -324,3 +324,3 @@
static int convert(const char *fn, int ConvType, char * progname) {
- char c;
+ int c;
char *tempFn;
Regards
Chris