diff options
author | Thomas White <taw@physics.org> | 2010-09-24 18:11:39 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2012-02-22 15:26:59 +0100 |
commit | 7e146b3b58eef65e630c082af362342e04eae099 (patch) | |
tree | aed6ed92614d31ad0572043068fc075775d81065 | |
parent | a48a07c11a473112d79a455cb8daa8cf4ba7a2d9 (diff) |
Fix the usage of basename()
-rw-r--r-- | src/cubeit.c | 4 | ||||
-rw-r--r-- | src/reintegrate.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/cubeit.c b/src/cubeit.c index d0c780c8..f6ff2c67 100644 --- a/src/cubeit.c +++ b/src/cubeit.c @@ -629,7 +629,7 @@ int main(int argc, char *argv[]) add_to_mean(cell, &as, &bs, &cs, &als, &bes, &gas); if ( config_basename ) { char *tmp; - tmp = basename(filename); + tmp = strdup(basename(filename)); free(filename); filename = tmp; } @@ -687,7 +687,7 @@ int main(int argc, char *argv[]) add_to_mean(cell, &as, &bs, &cs, &als, &bes, &gas); if ( config_basename ) { char *tmp; - tmp = basename(filename); + tmp = strdup(basename(filename)); free(filename); filename = tmp; } diff --git a/src/reintegrate.c b/src/reintegrate.c index 3a94c48f..af5f9e7a 100644 --- a/src/reintegrate.c +++ b/src/reintegrate.c @@ -254,7 +254,7 @@ static void integrate_all(int nthreads, struct detector *det, FILE *fh, if ( rval == 1 ) break; if ( config_basename ) { char *tmp; - tmp = basename(filename); + tmp = strdup(basename(filename)); free(filename); filename = tmp; } @@ -309,7 +309,7 @@ static void integrate_all(int nthreads, struct detector *det, FILE *fh, if ( rval == 1 ) break; if ( config_basename ) { char *tmp; - tmp = basename(filename); + tmp = strdup(basename(filename)); free(filename); filename = tmp; } |