- bug fix: zero length line could cause bochs to segfault. (Maybe it only

happened at the end.)
This commit is contained in:
Bryce Denney 2001-05-23 15:00:10 +00:00
parent 70099281ff
commit db2ae479cc
1 changed files with 3 additions and 1 deletions

View File

@ -677,7 +677,9 @@ parse_bochsrc(int argc)
do {
ret = fgets(line, sizeof(line)-1, fd);
line[sizeof(line) - 1] = '\0';
line[strlen(line) - 1] = '\0';
int len = strlen(line);
if (len>0)
line[len-1] = '\0';
if ((ret != NULL) && strlen(line)) {
parse_line_unformatted(line);
}