Here is a patch that fixes the problem.
diff -urNad neko-1.5.3~/vm/main.c neko-1.5.3/vm/main.c
--- neko-1.5.3~/vm/main.c 2007-03-04 14:00:16.000000000 +0100
+++ neko-1.5.3/vm/main.c 2007-03-04 14:01:09.000000000 +0100
@@ -66,7 +66,7 @@
int neko_has_embedded_module() {
char *exe = executable_path();
- char id[4];
+ unsigned char id[8];
int pos;
if( exe == NULL )
return 0;
@@ -74,14 +74,12 @@
if( self == NULL )
return 0;
fseek(self,-8,SEEK_END);
- fread(id,1,4,self);
+ fread(id,1,8,self);
if( id[0] != 'N' || id[1] != 'E' || id[2] != 'K' || id[3] != 'O' ) {
fclose(self);
return 0;
}
- fread(&pos,1,4,self);
- if( neko_is_big_endian() )
- pos = (pos >> 24) | ((pos >> 8) & 0xFF00) | ((pos << 8) &
0xFF0000)
| (pos << 24);
+ pos = id[4] | id[5] << 8 | id[6] << 16 | id[7] << 24;
fseek(self,pos,SEEK_SET);
return 1;
}
Cheers,
--
Jens Peter Secher.
_DD6A 05B0 174E BFB2 D4D9 B52E 0EE5 978A FE63 E8A1 jpsecher gmail com_.
A. Because it breaks the logical sequence of discussion.
Q. Why is top posting bad?
--
Neko : One VM to run them all
(http://nekovm.org)