Skip to content

Commit

Permalink
Got rid of a superfluous static buffer.
Browse files Browse the repository at this point in the history
  • Loading branch information
Wayne Davison committed Sep 20, 2004
1 parent 7d059d4 commit fb22c27
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions backup.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,14 @@ extern int safe_symlinks;
/* make a complete pathname for backup file */
char *get_backup_name(char *fname)
{
static char fnamebak[MAXPATHLEN];

if (backup_dir) {
if (stringjoin(backup_dir_buf + backup_dir_len, backup_dir_remainder,
fname, backup_suffix, NULL) < backup_dir_remainder)
return backup_dir_buf;
} else {
if (stringjoin(fnamebak, sizeof fnamebak,
fname, backup_suffix, NULL) < sizeof fnamebak)
return fnamebak;
if (stringjoin(backup_dir_buf, MAXPATHLEN,
fname, backup_suffix, NULL) < MAXPATHLEN)
return backup_dir_buf;
}

rprintf(FERROR, "backup filename too long\n");
Expand Down

0 comments on commit fb22c27

Please sign in to comment.