Skip to content

Commit

Permalink
carrierroute: do not test return for strcpy() and strcat()
Browse files Browse the repository at this point in the history
- they return the dst or src parameter, resulting in code analyzer
reporting

(cherry picked from commit 6515972)
(cherry picked from commit d597ecd)
  • Loading branch information
miconda committed Jul 16, 2020
1 parent e1193bd commit e89b9c4
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/modules/carrierroute/cr_config.c
Expand Up @@ -121,14 +121,8 @@ static int backup_config(void) {
PKG_MEM_ERROR;
return -1;
}
if(!strcpy(backup_file, config_file)){
LM_ERR("can't copy filename\n");
goto errout;
}
if(!strcat(backup_file, ".bak")){
LM_ERR("can't attach suffix\n");
goto errout;
}
strcpy(backup_file, config_file);
strcat(backup_file, ".bak");
/* open source file */
if ((from = fopen(config_file, "rb"))==NULL) {
LM_ERR("Cannot open source file.\n");
Expand Down

0 comments on commit e89b9c4

Please sign in to comment.