[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gnash-commit] /srv/bzr/gnash/trunk r10516: Fix backward comparison
From: |
Jason Woofenden |
Subject: |
Re: [Gnash-commit] /srv/bzr/gnash/trunk r10516: Fix backward comparison in getFileType |
Date: |
Wed, 7 Jan 2009 18:54:23 -0500 |
So, I'm probably not the only person that finds this syntax
confusing:
if (3 > in.read(buf, 3))
I think it'd be clearer for all of us if it read:
if (in.read(buf, 3) < 3)
Take care,
- Jason
>------------------------------------------------------------
>revno: 10516
>committer: Sandro Santilli <address@hidden>
>branch nick: trunk
>timestamp: Wed 2009-01-07 22:22:56 +0100
>message:
> Fix backward comparison in getFileType
>modified:
> libcore/impl.cpp
>=== modified file 'libcore/impl.cpp'
>--- a/libcore/impl.cpp 2009-01-05 09:32:03 +0000
>+++ b/libcore/impl.cpp 2009-01-07 21:22:56 +0000
>@@ -358,7 +358,7 @@
>
> char buf[3];
>
>- if (3 < in.read(buf, 3))
>+ if (3 > in.read(buf, 3))
> {
> log_error(_("Can't read file header"));
> in.seek(0);
>@@ -402,7 +402,7 @@
> // Check if it is an swf embedded in a player (.exe-file)
> if (std::equal(buf, buf + 2, "MZ")) {
>
>- if ( 3 < in.read(buf, 3) )
>+ if ( 3 > in.read(buf, 3) )
> {
> log_error(_("Can't read 3 bytes after an MZ (.exe) header"));
> in.seek(0);
>
>_______________________________________________
>Gnash-commit mailing list
>address@hidden
>http://lists.gnu.org/mailman/listinfo/gnash-commit