diff options
author | Gerald Combs <gerald@wireshark.org> | 2016-06-20 09:41:10 -0700 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2016-06-22 23:53:00 +0000 |
commit | d9fb7f9a5e2c08a5323ee7ed88956a0ccf62c634 (patch) | |
tree | abf88017e86709f0a9a7acb3d71bbccfdf8c4be3 /wsutil | |
parent | be303c20e51440000756341c564b97b1f3fcd308 (diff) |
Handle ENAMETOOLONG.
g_strerror doesn't appear to handle ENAMETOOLONG. Check for it ourselves.
Change-Id: Icd113a81e8d95bb3c84c91bb420a1a6a19bf5d40
Reviewed-on: https://code.wireshark.org/review/16041
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'wsutil')
-rw-r--r-- | wsutil/filesystem.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/wsutil/filesystem.c b/wsutil/filesystem.c index 87bf99b7ac..44cd026f6d 100644 --- a/wsutil/filesystem.c +++ b/wsutil/filesystem.c @@ -62,6 +62,7 @@ #include <wsutil/report_err.h> #include <wsutil/privileges.h> #include <wsutil/file_util.h> +#include <wsutil/utf8_entities.h> #include <wiretap/wtap.h> /* for WTAP_ERR_SHORT_WRITE */ @@ -1864,6 +1865,13 @@ file_open_error_message(int err, gboolean for_writing) errmsg = "The file \"%s\" could not be created because an invalid filename was specified."; break; +#ifdef ENAMETOOLONG + case ENAMETOOLONG: + /* XXX Make sure we truncate on a character boundary. */ + errmsg = "The file name \"%.80s" UTF8_HORIZONTAL_ELLIPSIS "\" is too long."; + break; +#endif + case ENOMEM: /* * The problem probably has nothing to do with how much RAM the |