From: Carsten Haitzler Date: Thu, 25 Mar 2004 03:05:27 +0000 (+0000) Subject: need a swap! X-Git-Tag: submit/devel/efl/20131022.203902~21981 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f14640499bfad42caba8e66d7ab78ccad6ee806b;p=platform%2Fupstream%2Fefl.git need a swap! SVN revision: 9457 --- diff --git a/legacy/embryo/src/bin/embryo_cc_sc2.c b/legacy/embryo/src/bin/embryo_cc_sc2.c index c04f90f..15ea338 100644 --- a/legacy/embryo/src/bin/embryo_cc_sc2.c +++ b/legacy/embryo/src/bin/embryo_cc_sc2.c @@ -1145,7 +1145,7 @@ static char *skipstring(char *string) } /* while */ endquote=*string; - assert(endquote=='"' || endquote=='\''); + assert(endquote=='\"' || endquote=='\''); string++; /* skip open quote */ while (*string!=endquote && *string!='\0') litchar(&string,rawstring); diff --git a/legacy/embryo/src/lib/embryo_amx.c b/legacy/embryo/src/lib/embryo_amx.c index bb5e3e5..ff1fe35 100644 --- a/legacy/embryo/src/lib/embryo_amx.c +++ b/legacy/embryo/src/lib/embryo_amx.c @@ -132,6 +132,7 @@ _embryo_program_init(Embryo_Program *ep, void *code) 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 * embryo_program_load(char *file) { Embryo_Program *ep; + Embryo_Header hdr; FILE *f; void *program = NULL; int program_size = 0; @@ -244,6 +246,14 @@ embryo_program_load(char *file) 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) {