signed to unsigned before comparing
[monky] / src / core.c
index 0c173da..7b50030 100644 (file)
@@ -1250,7 +1250,7 @@ int extract_variable_text_internal(struct text_object *retval, const char *const
                                }
 
                                /* copy variable to buffer */
-                               len = (p - s > text_buffer_size-1) ? text_buffer_size-1 : (p - s);
+                               len = ((unsigned int) (p - s) > text_buffer_size - 1) ? text_buffer_size - 1 : (unsigned int) (p - s);
                                strncpy(buf, s, len);
                                buf[len] = '\0';