Enlightenment CVS committal

Author  : raster
Project : e17
Module  : libs/embryo

Dir     : e17/libs/embryo/src/lib


Modified Files:
        embryo_amx.c 


Log Message:


need a swap!

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/embryo/src/lib/embryo_amx.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- embryo_amx.c        24 Mar 2004 09:48:28 -0000      1.1
+++ embryo_amx.c        25 Mar 2004 03:05:27 -0000      1.2
@@ -132,6 +132,7 @@
    embryo_swap_32((unsigned int *)&hdr->libraries);
    embryo_swap_32((unsigned int *)&hdr->pubvars);
    embryo_swap_32((unsigned int *)&hdr->tags);
+   embryo_swap_32((unsigned int *)&hdr->nametable);
 #endif
    
    if (hdr->magic != EMBRYO_MAGIC) return 0;
@@ -230,6 +231,7 @@
 embryo_program_load(char *file)
 {
    Embryo_Program *ep;
+   Embryo_Header   hdr;
    FILE *f;
    void *program = NULL;
    int program_size = 0;
@@ -244,6 +246,14 @@
        fclose(f);
        return NULL;
      }
+   if (fread(&hdr, sizeof(Embryo_Header), 1, f) != 1)
+     {
+       fclose(f);
+       return NULL;
+     }
+   rewind(f);
+   embryo_swap_32((unsigned int *)(&hdr.size));
+   if (hdr.size < program_size) program_size = hdr.size;
    program = malloc(program_size);
    if (!program)
      {




-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to