summaryrefslogtreecommitdiff
path: root/source3/lib/netapi/examples
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-08-29 12:59:56 +0200
committerGünther Deschner <gd@samba.org>2008-08-29 13:58:06 +0200
commitaf1db71c1446c854385de691781e5bb48ec65936 (patch)
treefc6834d7af91b92bf0c89fa6e01752a022c8241b /source3/lib/netapi/examples
parente710a871776eee47642ef828fd04cb0a46e43d2a (diff)
downloadsamba-af1db71c1446c854385de691781e5bb48ec65936.tar.gz
samba-af1db71c1446c854385de691781e5bb48ec65936.tar.bz2
samba-af1db71c1446c854385de691781e5bb48ec65936.zip
netapi: fix some warnings in netdomjoin-gui.
Guenther (This used to be commit e69eb09c1819eb4ea4bba7c3b3b0f8b6da789632)
Diffstat (limited to 'source3/lib/netapi/examples')
-rw-r--r--source3/lib/netapi/examples/netdomjoin-gui/netdomjoin-gui.c28
1 files changed, 20 insertions, 8 deletions
diff --git a/source3/lib/netapi/examples/netdomjoin-gui/netdomjoin-gui.c b/source3/lib/netapi/examples/netdomjoin-gui/netdomjoin-gui.c
index 970f8cf9f2..4e0488ed59 100644
--- a/source3/lib/netapi/examples/netdomjoin-gui/netdomjoin-gui.c
+++ b/source3/lib/netapi/examples/netdomjoin-gui/netdomjoin-gui.c
@@ -818,9 +818,13 @@ static void callback_enter_hostname_and_unlock(GtkWidget *widget,
}
state->hostname_changed = TRUE;
if (state->name_type_initial == NetSetupDomainName) {
- asprintf(&str, "%s.%s", entry_text, state->my_dnsdomain);
+ if (asprintf(&str, "%s.%s", entry_text, state->my_dnsdomain) == -1) {
+ return;
+ }
} else {
- asprintf(&str, "%s.", entry_text);
+ if (asprintf(&str, "%s.", entry_text) == -1) {
+ return;
+ }
}
gtk_label_set_text(GTK_LABEL(state->label_full_computer_name), str);
free(str);
@@ -1127,10 +1131,14 @@ static void callback_do_change(GtkWidget *widget,
char *str = NULL;
entry_text = gtk_entry_get_text(GTK_ENTRY(entry));
if (state->name_type_initial == NetSetupDomainName) {
- asprintf(&str, "%s.%s", entry_text,
- state->my_dnsdomain);
+ if (asprintf(&str, "%s.%s", entry_text,
+ state->my_dnsdomain) == -1) {
+ return;
+ }
} else {
- asprintf(&str, "%s.", entry_text);
+ if (asprintf(&str, "%s.", entry_text) == -1) {
+ return;
+ }
}
gtk_label_set_text(GTK_LABEL(state->label_full_computer_name),
str);
@@ -1431,10 +1439,14 @@ static int draw_main_window(struct join_state *state)
/* Label */
char *str = NULL;
if (state->name_type_initial == NetSetupDomainName) {
- asprintf(&str, "%s.%s", state->my_hostname,
- state->my_dnsdomain);
+ if (asprintf(&str, "%s.%s", state->my_hostname,
+ state->my_dnsdomain) == -1) {
+ return -1;
+ }
} else {
- asprintf(&str, "%s.", state->my_hostname);
+ if (asprintf(&str, "%s.", state->my_hostname) == -1) {
+ return -1;
+ }
}
label = gtk_label_new(str);