- bug fix: zero length line could cause bochs to segfault. (Maybe it only
happened at the end.)
This commit is contained in:
parent
70099281ff
commit
db2ae479cc
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user