diff --git a/src/files.c b/src/files.c
index 58355fad51d54824e81307086ab0f92a0f5903f3..dff741193c52cf440bbe608f79924417ea9ef0ed 100644
--- a/src/files.c
+++ b/src/files.c
@@ -2136,7 +2136,7 @@ bool do_writeout(bool exiting)
 		}
 #ifndef NANO_TINY
 
-		if (name_exists && (openfile->current_stat && openfile->current_stat->st_mtime < st.st_mtime ||
+		if (name_exists && openfile->current_stat && (openfile->current_stat->st_mtime < st.st_mtime ||
                     openfile->current_stat->st_dev != st.st_dev || openfile->current_stat->st_ino != st.st_ino)) {
 		    i = do_yesno_prompt(FALSE,
 			_("File was modified since you opened it, continue saving ? "));