OpenWrt Forum Archive

Topic: Minor typo in mini_httpd patch...

The content of this topic has been archived on 14 Mar 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Just noticed a little typo in the patch to add MatrixSSL support to mini_httpd:

http://nthill.free.fr/openwrt/sources/m … .19-3.diff

+    if ( matrixSslReadKeys( &keys, certfile, certfile, NULL, NULL < 0) )

should probably be

+    if ( matrixSslReadKeys( &keys, certfile, certfile, NULL, NULL) < 0 )

I think it's harmless in this case... smile

armcc wrote:

Just noticed a little typo in the patch to add MatrixSSL support to mini_httpd:

http://nthill.free.fr/openwrt/sources/m … .19-3.diff

+    if ( matrixSslReadKeys( &keys, certfile, certfile, NULL, NULL < 0) )

should probably be

+    if ( matrixSslReadKeys( &keys, certfile, certfile, NULL, NULL) < 0 )

I think it's harmless in this case... smile

If it follows the old (and dumb) unix truism that zero is a truth value then it's not a harmless typo.
But that surely depends on what comes next. smile

NULL < 0 is going to evaluate to false for just about any sane environment, so unless this code is from the Obfuscated C contest, I'd agree that it's most likely a typo.

As to whether it is harmful or harmless depends on the behaviour before and after the change. I suspect that the proposed fix is the right thing to do.

Just noticed a little typo in the patch to add MatrixSSL support to mini_httpd:

http://nthill.free.fr/openwrt/sources/m … .19-3.diff

This stuff is obsolete, but thanks for the review, the patch has been fixed in CVS (head)

> This stuff is obsolete, but thanks for the review, the patch has been fixed in CVS (head)

You're welcome smile

Which stuff exactly is obsolete ?
Latest upstream mini_httpd is still v1.19 (although latest MatrixSSL is now 1.7.1 compared to 1.2.4 in openwrt CVS).
Or do you mean the patches from the source link in package tracker ??

The discussion might have continued from here.