aboutsummaryrefslogtreecommitdiff
path: root/src/displaywindow.c
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2010-12-07 18:11:18 -0700
committerThomas White <taw@physics.org>2012-02-22 15:27:08 +0100
commit5084f60ed55119d709cfd7f75fcc5823f58bc094 (patch)
tree5accca8352c77a852d6fec8b67fc6c3b810586e1 /src/displaywindow.c
parentc85230a897b62f223951f7cc5693c6175e2d673d (diff)
Remove use of horribly ambiguous basename() function
Diffstat (limited to 'src/displaywindow.c')
-rw-r--r--src/displaywindow.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/displaywindow.c b/src/displaywindow.c
index b37a483a..04377ef5 100644
--- a/src/displaywindow.c
+++ b/src/displaywindow.c
@@ -1137,8 +1137,10 @@ DisplayWindow *displaywindow_open(const char *filename, const char *peaks,
if ( filename == NULL ) {
title = strdup("No file - hdfsee");
} else {
- title = malloc(strlen(basename(filename))+14);
- sprintf(title, "%s - hdfsee", basename(filename));
+ char *bn = safe_basename(filename);
+ title = malloc(strlen(bn)+14);
+ sprintf(title, "%s - hdfsee", bn);
+ free(bn);
}
gtk_window_set_title(GTK_WINDOW(dw->window), title);
free(title);