aboutsummaryrefslogtreecommitdiffstats
path: root/ui/profile.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2015-01-09 23:04:47 -0500
committerMichael Mann <mmann78@netscape.net>2015-01-10 04:20:27 +0000
commit5fe1f6617650f8fae37d53b038570fd941311f68 (patch)
tree2bcccbd9acb1df211026fe8502f93a45cbfa62b9 /ui/profile.c
parent3a9869d81a686effc4f8139e019333ca9e87e0ca (diff)
Finish off emem_strbuf_t usage.
Change-Id: Ib0b911c86a7f8a7cca022e9e324c910664ce397e Reviewed-on: https://code.wireshark.org/review/6461 Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'ui/profile.c')
-rw-r--r--ui/profile.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/ui/profile.c b/ui/profile.c
index 0aed43e06f..62b46517ec 100644
--- a/ui/profile.c
+++ b/ui/profile.c
@@ -114,7 +114,6 @@ const gchar *apply_profile_changes(void) {
GList *fl1, *fl2;
profile_def *profile1, *profile2;
gboolean found;
- emem_strbuf_t *message = ep_strbuf_new(NULL);
const gchar *err_msg;
/* First validate all profile names */
@@ -123,8 +122,7 @@ const gchar *apply_profile_changes(void) {
profile1 = (profile_def *) fl1->data;
g_strstrip(profile1->name);
if ((err_msg = profile_name_is_valid(profile1->name)) != NULL) {
- ep_strbuf_printf(message, "%s", err_msg);
- return message->str;
+ return err_msg;
}
fl1 = g_list_next(fl1);
}
@@ -136,11 +134,11 @@ const gchar *apply_profile_changes(void) {
g_strstrip(profile1->name);
if (profile1->status == PROF_STAT_COPY) {
if (create_persconffile_profile(profile1->name, &pf_dir_path) == -1) {
- ep_strbuf_printf(message,
- "Can't create directory\n\"%s\":\n%s.",
+ err_msg = g_strdup_printf("Can't create directory\n\"%s\":\n%s.",
pf_dir_path, g_strerror(errno));
g_free(pf_dir_path);
+ return err_msg;
}
profile1->status = PROF_STAT_EXISTS;
@@ -354,7 +352,7 @@ const gchar *
profile_name_is_valid(const gchar *name)
{
gchar *reason = NULL;
- emem_strbuf_t *message = ep_strbuf_new(NULL);
+ gchar *message;
#ifdef _WIN32
char *invalid_dir_char = "\\/:*?\"<>|";
@@ -383,9 +381,9 @@ profile_name_is_valid(const gchar *name)
#endif
if (reason) {
- ep_strbuf_printf(message, "A profile name cannot %s\nProfiles unchanged.", reason);
+ message = g_strdup_printf("A profile name cannot %s\nProfiles unchanged.", reason);
g_free(reason);
- return message->str;
+ return message;
}
return NULL;