Skip to content

Commit

Permalink
Fixed unit test crash.
Browse files Browse the repository at this point in the history
  • Loading branch information
BlockoS committed Mar 15, 2020
1 parent 79f504d commit 3227153
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tinypds.h
Original file line number Diff line number Diff line change
Expand Up @@ -430,10 +430,12 @@ static void PDS_error(PDS_parser *parser, const char *current, int error, const
parser->status = error;
if(0 != parser->callbacks.error) {
PDS_error_description description;
description.line_first = parser->line;
for(description.line_last = parser->line; description.line_last != parser->last; description.line_last++) {
if('\n' == *description.line_last) {
break;
description.line_first = description.line_last = parser->line;
if(description.line_last) {
for(; description.line_last != parser->last; description.line_last++) {
if('\n' == *description.line_last) {
break;
}
}
}
description.number = parser->line_num;
Expand Down

0 comments on commit 3227153

Please sign in to comment.