aboutsummaryrefslogtreecommitdiffstats
path: root/src/xselect.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/xselect.c')
-rw-r--r--src/xselect.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/xselect.c b/src/xselect.c
index 5254fa96838..451b2a0b13f 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -2190,7 +2190,8 @@ and t is the same as `SECONDARY'. */)
2190***********************************************************************/ 2190***********************************************************************/
2191/* Check that lisp values are of correct type for x_fill_property_data. 2191/* Check that lisp values are of correct type for x_fill_property_data.
2192 That is, number, string or a cons with two numbers (low and high 16 2192 That is, number, string or a cons with two numbers (low and high 16
2193 bit parts of a 32 bit number). */ 2193 bit parts of a 32 bit number). Return the number of items in DATA,
2194 or -1 if there is an error. */
2194 2195
2195int 2196int
2196x_check_property_data (Lisp_Object data) 2197x_check_property_data (Lisp_Object data)
@@ -2198,15 +2199,16 @@ x_check_property_data (Lisp_Object data)
2198 Lisp_Object iter; 2199 Lisp_Object iter;
2199 int size = 0; 2200 int size = 0;
2200 2201
2201 for (iter = data; CONSP (iter) && size != -1; iter = XCDR (iter), ++size) 2202 for (iter = data; CONSP (iter); iter = XCDR (iter))
2202 { 2203 {
2203 Lisp_Object o = XCAR (iter); 2204 Lisp_Object o = XCAR (iter);
2204 2205
2205 if (! NUMBERP (o) && ! STRINGP (o) && ! CONSP (o)) 2206 if (! NUMBERP (o) && ! STRINGP (o) && ! CONSP (o))
2206 size = -1; 2207 return -1;
2207 else if (CONSP (o) && 2208 else if (CONSP (o) &&
2208 (! NUMBERP (XCAR (o)) || ! NUMBERP (XCDR (o)))) 2209 (! NUMBERP (XCAR (o)) || ! NUMBERP (XCDR (o))))
2209 size = -1; 2210 return -1;
2211 size++;
2210 } 2212 }
2211 2213
2212 return size; 2214 return size;