diff --git a/ChangeLog b/ChangeLog
index c5dbc26ef08626920b164556843eacb527b693e4..928f067109d627efee1e1c4422e4fe942c4cb216 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -100,6 +100,9 @@ CVS code -
 - nano.h:
 	- Remove the manual disabling of color support if regex.h isn't
 	  found, as configure.ac now handles that. (DLR)
+- search.c:
+  replace_regexp()
+	- Remove unnecessary casting of c to int. (DLR)
 - text.c:
   execute_command()
 	- Remove the marking of the file as modified, as do_insertfile()
diff --git a/src/search.c b/src/search.c
index bb02e4a86e6eeded5567eabd1c57ca48a26861a3..1842d1205e907954b5084ef9e422cd279f7bd2b5 100644
--- a/src/search.c
+++ b/src/search.c
@@ -576,7 +576,7 @@ int replace_regexp(char *string, bool create)
     /* Iterate through the replacement text to handle subexpression
      * replacement using \1, \2, \3, etc. */
     while (*c != '\0') {
-	int num = (int)(*(c + 1) - '0');
+	int num = (*(c + 1) - '0');
 
 	if (*c != '\\' || num < 1 || num > 9 || num >
 		search_regexp.re_nsub) {