Browse Source

1999-01-10 Ilya Zakharevich <ilya@math.ohio-state.edu>

        * gtkedit/edit.c (edit_load_file): Off-by-one error disabled editing.
Miguel de Icaza 26 years ago
parent
commit
371d2dc545
1 changed files with 1 additions and 1 deletions
  1. 1 1
      gtkedit/edit.c

+ 1 - 1
gtkedit/edit.c

@@ -257,7 +257,7 @@ int edit_load_file (WEdit * edit, const char *filename, const char *text, unsign
 #if defined CR_LF_TRANSLATION
 	if(file && (!text)){
 		real_size=0;
-		tmp_buf[1024]=0;
+		tmp_buf[sizeof (tmp_buf)-1]=0;
 		while((bytes_read = read(file,tmp_buf,1024)) > 0){
 			real_size += bytes_read;
 		}