diff options
author | Patrick Griffis <tingping@tingping.se> | 2016-09-11 15:49:06 -0400 |
---|---|---|
committer | Patrick Griffis <tingping@tingping.se> | 2016-09-11 15:50:19 -0400 |
commit | 15600f405f2d5bda6ccf0dd73957395716e0d4d3 (patch) | |
tree | 4ce2f64ecd8eb0d9255701f7e2c10ebf28fd20bc /src | |
parent | 910851e04daad2927d6a3795205afb85e4d164e4 (diff) |
Sanitize network name for scrollback files
This prevents using invalid chars on Windows or creating directories
Diffstat (limited to 'src')
-rw-r--r-- | src/common/text.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/common/text.c b/src/common/text.c index 2af8ab09..1e9b3132 100644 --- a/src/common/text.c +++ b/src/common/text.c @@ -79,6 +79,7 @@ scrollback_get_filename (session *sess) if (!net) return NULL; + net = log_create_filename (net); buf = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "scrollback" G_DIR_SEPARATOR_S "%s" G_DIR_SEPARATOR_S "%s.txt", get_xdir (), net, ""); mkdir_p (buf); g_free (buf); @@ -89,6 +90,7 @@ scrollback_get_filename (session *sess) else buf = NULL; g_free (chan); + g_free (net); if (buf) { |