Skip to content

Commit

Permalink
carrierroute: check return value for fseek
Browse files Browse the repository at this point in the history
  • Loading branch information
Claudiu Boriga committed Aug 1, 2017
1 parent d8fdcb3 commit 3a9365f
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/modules/carrierroute/parser_carrierroute.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,10 @@ int parse_options(FILE* file, option_description* opts, int no_options, char* en
/* parsing stops when end_str is reached: e.g: }, target */
if ( strncmp(data.s, end_str, strlen(end_str)) == 0){
LM_DBG("End of options list received \n");
fseek(file, -full_line_len, SEEK_CUR);
if (fseek(file, -full_line_len, SEEK_CUR) != 0){
LM_ERR("fseek failed: %s",strerror(errno));
break;
}
ret = SUCCESSFUL_PARSING;
break;
}
Expand Down Expand Up @@ -385,9 +388,11 @@ int parse_struct_header(FILE* file, char* expected_struct_type, str* struct_name
memcpy(struct_name->s, name, struct_name->len);
struct_name->s[struct_name->len]='\0';
}
else
fseek(file, -full_line_len, SEEK_CUR);

else{
if (fseek(file, -full_line_len, SEEK_CUR) != 0){
LM_ERR("fseek failed: %s",strerror(errno));
}
}
return ret;
}

Expand Down

0 comments on commit 3a9365f

Please sign in to comment.