Enlightenment CVS committal

Author  : raster
Project : e17
Module  : libs/imlib2

Dir     : e17/libs/imlib2/src/modules/loaders


Modified Files:
        loader_xpm.c 


Log Message:


xpm segv fix

===================================================================
RCS file: 
/cvsroot/enlightenment/e17/libs/imlib2/src/modules/loaders/loader_xpm.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- loader_xpm.c        4 Jan 2005 03:34:03 -0000       1.3
+++ loader_xpm.c        18 May 2005 05:27:43 -0000      1.4
@@ -108,7 +108,7 @@
    FILE               *f;
 
    int                 pc, c, i, j, k, w, h, ncolors, cpp, comment, transp,
-       quote, context, len, done, r, g, b;
+       quote, context, len, done, r, g, b, backslash;
    char               *line, s[256], tok[128], col[256];
    int                 lsz = 256;
    struct _cmap {
@@ -163,6 +163,7 @@
    pixels = 0;
    count = 0;
    line = malloc(lsz);
+   backslash = 0;
    memset(lookup, 0, sizeof(lookup));
    while (!done)
      {
@@ -645,7 +646,18 @@
                 c = 32;
              else if (c > 127)
                 c = 127;
-             line[i++] = c;
+            if ( c=='\\' ) {
+              if ( ++backslash<2 ) {
+                line[i++] = c;
+              }
+              else {
+                backslash = 0;
+              }
+            }
+            else {
+              backslash = 0;
+              line[i++] = c;
+            }
           }
         if (i >= lsz)
           {




-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to