Enlightenment CVS committal Author : raster Project : e17 Module : libs/efreet
Dir : e17/libs/efreet/src/lib Modified Files: efreet_ini.c Log Message: efreet segv maker removed. bad unescaping causing segvs! fixxored. =================================================================== RCS file: /cvs/e/e17/libs/efreet/src/lib/efreet_ini.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -3 -r1.8 -r1.9 --- efreet_ini.c 4 Nov 2007 09:32:35 -0000 1.8 +++ efreet_ini.c 3 May 2008 09:25:43 -0000 1.9 @@ -69,28 +69,22 @@ efreet_ini_parse(const char *file) { FILE *f; - /* a static buffer for quick reading of lines that fit */ char static_buf[4096]; - int static_buf_len = 4096; - /* a big buffer to allocate for lines that are larger than the static one */ char *big_buf = NULL; int big_buf_len = 0; - int big_buf_step = static_buf_len; - + int big_buf_step = sizeof(static_buf); /* the current location to read into (with fgets) and the amount to read */ char *read_buf; int read_len; - /* the current buffer to parse */ char *buf; - Ecore_Hash *data, *section = NULL; /* start with the static buffer */ buf = read_buf = static_buf; - read_len = static_buf_len; + read_len = sizeof(static_buf); f = fopen(file, "rb"); if (!f) return NULL; @@ -229,7 +223,7 @@ next_line: /* finished parsing a line. use static buffer for next line */ buf = read_buf = static_buf; - read_len = static_buf_len; + read_len = sizeof(static_buf); read_buf[read_len - 2] = '\n'; } @@ -587,7 +581,7 @@ dest = buf; while(*p) { - if (*p == '\\') + if ((*p == '\\') && (p[1] != '\0')) { p++; switch (*p) ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs