summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2011-06-19 23:03:10 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2011-06-19 23:03:10 -0700
commit74ca2eb34bb66901b04d33cbef16ff7c8d8df551 (patch)
tree36e5c1677c448f55bc64ef00c200fba1170c0b2e /src
parent9bda3520ff9b70be8645e0ebc38cf212208c444b (diff)
* image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
Don't assume string length fits in int.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog3
-rw-r--r--src/image.c16
2 files changed, 6 insertions, 13 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 16e8342ee0b..4928e209364 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,8 @@
2011-06-20 Paul Eggert <eggert@cs.ucla.edu>
+ * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
+ Don't assume string length fits in int.
+
* gtkutil.c (style_changed_cb): Avoid need for strlen.
* font.c: Don't assume string length fits in int.
diff --git a/src/image.c b/src/image.c
index 352f8c486e4..b5b93cb5b69 100644
--- a/src/image.c
+++ b/src/image.c
@@ -3589,25 +3589,14 @@ xpm_load (struct frame *f, struct image *img)
/* XPM support functions for NS where libxpm is not available.
Only XPM version 3 (without any extensions) is supported. */
-static int xpm_scan (const unsigned char **, const unsigned char *,
- const unsigned char **, int *);
-static Lisp_Object xpm_make_color_table_v
- (void (**) (Lisp_Object, const unsigned char *, int, Lisp_Object),
- Lisp_Object (**) (Lisp_Object, const unsigned char *, int));
static void xpm_put_color_table_v (Lisp_Object, const unsigned char *,
int, Lisp_Object);
static Lisp_Object xpm_get_color_table_v (Lisp_Object,
const unsigned char *, int);
-static Lisp_Object xpm_make_color_table_h
- (void (**) (Lisp_Object, const unsigned char *, int, Lisp_Object),
- Lisp_Object (**) (Lisp_Object, const unsigned char *, int));
static void xpm_put_color_table_h (Lisp_Object, const unsigned char *,
int, Lisp_Object);
static Lisp_Object xpm_get_color_table_h (Lisp_Object,
const unsigned char *, int);
-static int xpm_str_to_color_key (const char *);
-static int xpm_load_image (struct frame *, struct image *,
- const unsigned char *, const unsigned char *);
/* Tokens returned from xpm_scan. */
@@ -3629,7 +3618,7 @@ static int
xpm_scan (const unsigned char **s,
const unsigned char *end,
const unsigned char **beg,
- int *len)
+ ptrdiff_t *len)
{
int c;
@@ -3799,7 +3788,8 @@ xpm_load_image (struct frame *f,
unsigned char buffer[BUFSIZ];
int width, height, x, y;
int num_colors, chars_per_pixel;
- int len, LA1;
+ ptrdiff_t len;
+ int LA1;
void (*put_color_table) (Lisp_Object, const unsigned char *, int, Lisp_Object);
Lisp_Object (*get_color_table) (Lisp_Object, const unsigned char *, int);
Lisp_Object frame, color_symbols, color_table;