diff options
author | Christian Grothoff <christian@grothoff.org> | 2020-04-11 11:28:36 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2020-04-11 11:28:36 +0200 |
commit | 912181afd31184ae6739b927315d09c13a952f73 (patch) | |
tree | b0b16a8ebb9d3a3592307893f68d310207219af0 /src/examples | |
parent | f4be5e015488659dc68dadbaca5a479e7b12d09c (diff) | |
download | libmicrohttpd-912181afd31184ae6739b927315d09c13a952f73.tar.gz libmicrohttpd-912181afd31184ae6739b927315d09c13a952f73.zip |
fix more warnings
Diffstat (limited to 'src/examples')
-rw-r--r-- | src/examples/digest_auth_example.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/examples/digest_auth_example.c b/src/examples/digest_auth_example.c index e3edf206..073726ad 100644 --- a/src/examples/digest_auth_example.c +++ b/src/examples/digest_auth_example.c | |||
@@ -46,6 +46,7 @@ ahc_echo (void *cls, | |||
46 | char *username; | 46 | char *username; |
47 | const char *password = "testpass"; | 47 | const char *password = "testpass"; |
48 | const char *realm = "test@example.com"; | 48 | const char *realm = "test@example.com"; |
49 | int res; | ||
49 | enum MHD_Result ret; | 50 | enum MHD_Result ret; |
50 | (void) cls; /* Unused. Silent compiler warning. */ | 51 | (void) cls; /* Unused. Silent compiler warning. */ |
51 | (void) url; /* Unused. Silent compiler warning. */ | 52 | (void) url; /* Unused. Silent compiler warning. */ |
@@ -68,13 +69,13 @@ ahc_echo (void *cls, | |||
68 | MHD_destroy_response (response); | 69 | MHD_destroy_response (response); |
69 | return ret; | 70 | return ret; |
70 | } | 71 | } |
71 | ret = MHD_digest_auth_check (connection, realm, | 72 | res = MHD_digest_auth_check (connection, realm, |
72 | username, | 73 | username, |
73 | password, | 74 | password, |
74 | 300); | 75 | 300); |
75 | MHD_free (username); | 76 | MHD_free (username); |
76 | if ( (ret == MHD_INVALID_NONCE) || | 77 | if ( (res == MHD_INVALID_NONCE) || |
77 | (ret == MHD_NO) ) | 78 | (res == MHD_NO) ) |
78 | { | 79 | { |
79 | response = MHD_create_response_from_buffer (strlen (DENIED), | 80 | response = MHD_create_response_from_buffer (strlen (DENIED), |
80 | DENIED, | 81 | DENIED, |
@@ -84,7 +85,7 @@ ahc_echo (void *cls, | |||
84 | ret = MHD_queue_auth_fail_response (connection, realm, | 85 | ret = MHD_queue_auth_fail_response (connection, realm, |
85 | MY_OPAQUE_STR, | 86 | MY_OPAQUE_STR, |
86 | response, | 87 | response, |
87 | (ret == MHD_INVALID_NONCE) ? MHD_YES : | 88 | (res == MHD_INVALID_NONCE) ? MHD_YES : |
88 | MHD_NO); | 89 | MHD_NO); |
89 | MHD_destroy_response (response); | 90 | MHD_destroy_response (response); |
90 | return ret; | 91 | return ret; |