summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2015-06-30 20:41:55 +0200
committerVolker Lendecke <vl@samba.org>2015-10-28 16:00:21 +0100
commit7e45bec38fe31be3fdad1d42bfdd7136c1663ba5 (patch)
treea01e1a27cb08f3ca8c2611c9c976a06600831ab9 /examples
parentaf03f5b4e838003b1d9f2e77239f28e1e363d463 (diff)
downloadsamba-7e45bec38fe31be3fdad1d42bfdd7136c1663ba5.tar.gz
examples: Fix unchecked result warnings
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'examples')
-rw-r--r--examples/libsmbclient/get_auth_data_fn.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/examples/libsmbclient/get_auth_data_fn.h b/examples/libsmbclient/get_auth_data_fn.h
index 6b91c973375..5f2be72a633 100644
--- a/examples/libsmbclient/get_auth_data_fn.h
+++ b/examples/libsmbclient/get_auth_data_fn.h
@@ -16,6 +16,7 @@ get_auth_data_fn(const char * pServer,
char workgroup[256] = { '\0' };
char username[256] = { '\0' };
char password[256] = { '\0' };
+ char *ret;
static int krb5_set = 1;
@@ -36,7 +37,10 @@ get_auth_data_fn(const char * pServer,
}
fprintf(stdout, "Workgroup: [%s] ", pWorkgroup);
- fgets(temp, sizeof(temp), stdin);
+ ret = fgets(temp, sizeof(temp), stdin);
+ if (ret == NULL) {
+ return;
+ }
if (temp[strlen(temp) - 1] == '\n') /* A new line? */
{
@@ -49,7 +53,10 @@ get_auth_data_fn(const char * pServer,
}
fprintf(stdout, "Username: [%s] ", pUsername);
- fgets(temp, sizeof(temp), stdin);
+ ret = fgets(temp, sizeof(temp), stdin);
+ if (ret == NULL) {
+ return;
+ }
if (temp[strlen(temp) - 1] == '\n') /* A new line? */
{
@@ -62,7 +69,10 @@ get_auth_data_fn(const char * pServer,
}
fprintf(stdout, "Password: ");
- fgets(temp, sizeof(temp), stdin);
+ ret = fgets(temp, sizeof(temp), stdin);
+ if (ret == NULL) {
+ return;
+ }
if (temp[strlen(temp) - 1] == '\n') /* A new line? */
{