im.pidgin.pidgin: 3f255830c687ae1da6294f773321ca6684bb1722
rlaager at pidgin.im
rlaager at pidgin.im
Sun Jan 13 23:22:31 EST 2008
-----------------------------------------------------------------
Revision: 3f255830c687ae1da6294f773321ca6684bb1722
Ancestor: 86444fc78caf0bd737a735a030502a10877ed050
Author: rlaager at pidgin.im
Date: 2008-01-13T20:46:18
Branch: im.pidgin.pidgin
Modified files:
libpurple/example/nullclient.c
ChangeLog:
Part of a large patch from o_sukhodolsky to fix some build warnings.
Refs #1344
-------------- next part --------------
============================================================
--- libpurple/example/nullclient.c 08d9c194f25b71d19480ef876f75916c7216c197
+++ libpurple/example/nullclient.c 185869e7e3df0f26d68ed69b26bb0d608135480b
@@ -268,6 +268,7 @@ int main(int argc, char *argv[])
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 @@ int main(int argc, char *argv[])
}
}
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 */
More information about the Commits
mailing list