On Wed, 26 Nov 2008, Francis Giraldeau wrote:

> I looked at the code for libssh2, and when 32 bit integer is received, then 
> a conversion should be done from network order to host order. It seems that 
> the function does always assume that the code is running on little endian 
> architecture, because there is no reference to __LITTLE_ENDIAN flag :
>
> /* {{{ libssh2_htonu32
> */
> void
> libssh2_htonu32(unsigned char *buf, unsigned long value)
> {
>    buf[0] = (value >> 24) & 0xFF;
>    buf[1] = (value >> 16) & 0xFF;
>    buf[2] = (value >> 8) & 0xFF;
>    buf[3] = value & 0xFF;
> }
>
> Does it means that the code will not work on other architectures?

It certainly looks that way given this snippet. I figure the only sensible 
thing is to build libssh2 on a big-endian machine and run it and see. Then fix 
the problems and send a patch for that to this list!

-- 

  / daniel.haxx.se

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
libssh2-devel mailing list
libssh2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libssh2-devel

Reply via email to