svn commit: r298924 - head/usr.bin/sdiff

Conrad Meyer cem at FreeBSD.org
Mon May 2 15:32:20 UTC 2016


Clang should really catch this too.  Why didn't it?

Best,
Conrad

On Mon, May 2, 2016 at 8:07 AM, Bjoern A. Zeeb <bz at freebsd.org> wrote:
> Author: bz
> Date: Mon May  2 15:07:43 2016
> New Revision: 298924
> URL: https://svnweb.freebsd.org/changeset/base/298924
>
> Log:
>   fgetc returns an int not a char.
>
>   Found by:   powerpc builds failing due to comparing with EOF raised:
>   "comparison is always false due to limited range of data type"
>
> Modified:
>   head/usr.bin/sdiff/sdiff.c
>
> Modified: head/usr.bin/sdiff/sdiff.c
> ==============================================================================
> --- head/usr.bin/sdiff/sdiff.c  Mon May  2 14:35:57 2016        (r298923)
> +++ head/usr.bin/sdiff/sdiff.c  Mon May  2 15:07:43 2016        (r298924)
> @@ -508,8 +508,7 @@ binexec(char *diffprog, char *f1, char *
>  static int
>  istextfile(FILE *f)
>  {
> -       int     i;
> -       char ch;
> +       int     ch, i;
>
>         if (f == NULL)
>                 return (1);
>


More information about the svn-src-head mailing list