diff --git a/ChangeLog b/ChangeLog
index 281fb9d20f05b9a847cf0327340bed085a86b4d2..1c42e8ed8b9c7b3a4931fd4887a4fb5ecfe0073d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+2010-01-05 Tito <farmatito@tiscali.it>
+	* search.c (update_history) - Fix bad length check causing search crash on armel platform.
+
 2010-01-04 Chris Allegretta <chrisa@asty.org>
 	* winio.c: edit_update, edit_redraw - Fix search not scrolling to the middle of the screen
 	  (reported by alpha@qzx.com) and places where we rely on maxrows but should not.
diff --git a/src/search.c b/src/search.c
index 82cc80b039a3ddb84e39c9f4901b43ab7e399fe4..6cb94696233f04554a92562c080cdc2ecb5575b9 100644
--- a/src/search.c
+++ b/src/search.c
@@ -1357,7 +1357,7 @@ void update_history(filestruct **h, const char *s)
     assert(hage != NULL && hbot != NULL);
 
     /* If this string is already in the history, delete it. */
-    p = find_history(*hage, *hbot, s, (size_t)-1);
+    p = find_history(*hage, *hbot, s, strlen(s));
 
     if (p != NULL) {
 	filestruct *foo, *bar;