aboutsummaryrefslogtreecommitdiff
path: root/src/cubeit.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2010-09-24 18:11:39 +0200
committerThomas White <taw@physics.org>2012-02-22 15:26:59 +0100
commit7e146b3b58eef65e630c082af362342e04eae099 (patch)
treeaed6ed92614d31ad0572043068fc075775d81065 /src/cubeit.c
parenta48a07c11a473112d79a455cb8daa8cf4ba7a2d9 (diff)
Fix the usage of basename()
Diffstat (limited to 'src/cubeit.c')
-rw-r--r--src/cubeit.c4
1 files changed, 2 insertions, 2 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;
}