diff src/ops.c @ 3626:802b1a1b275f v7.3.573

updated for version 7.3.573 Problem: Using array index before bounds checking. Solution: Swap the parts of the condition. (Dominique Pelle)
author Bram Moolenaar <bram@vim.org>
date Fri, 29 Jun 2012 13:34:19 +0200
parents 443c50cd3e88
children b9aa7fb4a928
line wrap: on
line diff
--- a/src/ops.c
+++ b/src/ops.c
@@ -6458,7 +6458,7 @@ line_count_info(line, wc, cc, limit, eol
     long	chars = 0;
     int		is_word = 0;
 
-    for (i = 0; line[i] && i < limit; )
+    for (i = 0; i < limit && line[i] != NUL; )
     {
 	if (is_word)
 	{