# HG changeset patch # User Richard Laager # Date 1200257178 0 # Node ID 3684c9d16f6fbeb18d42a1f8357cdfa78c53ab1c # Parent 542d35f101ffff6ebec05e12fefdecb7e11a63da Part of a large patch from o_sukhodolsky to fix some build warnings. Refs #1344 diff -r 542d35f101ff -r 3684c9d16f6f libpurple/example/nullclient.c --- a/libpurple/example/nullclient.c Sun Jan 13 16:44:39 2008 +0000 +++ b/libpurple/example/nullclient.c Sun Jan 13 20:46:18 2008 +0000 @@ -268,6 +268,7 @@ GMainLoop *loop = g_main_loop_new(NULL, FALSE); PurpleAccount *account; PurpleSavedStatus *status; + char *res; /* libpurple's built-in DNS resolution forks processes to perform * blocking lookups without blocking the main process. It does not @@ -290,12 +291,20 @@ } } printf("Select the protocol [0-%d]: ", i-1); - fgets(name, sizeof(name), stdin); + res = fgets(name, sizeof(name), stdin); + if (!res) { + fprintf(stderr, "Failed to gets protocol selection."); + abort(); + } sscanf(name, "%d", &num); prpl = g_list_nth_data(names, num); printf("Username: "); - fgets(name, sizeof(name), stdin); + res = fgets(name, sizeof(name), stdin); + if (!res) { + fprintf(stderr, "Failed to read user name."); + abort(); + } name[strlen(name) - 1] = 0; /* strip the \n at the end */ /* Create the account */