Skip to content

Commit 36fc3f0

Browse files
ysyrotaAaronAtDuo
authored andcommitted
Fixed some compiler warnings
1 parent b6718e2 commit 36fc3f0

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

lib/duo.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ _duo_seterr(struct duo_ctx *ctx, const char *fmt, ...)
246246
static void
247247
_duo_get_hostname(char *dns_fqdn, size_t dns_fqdn_size)
248248
{
249-
struct addrinfo hints, *info, *p;
249+
struct addrinfo hints, *info;
250250
char hostname[HOST_NAME_MAX + 1];
251251

252252
/* gethostname may not insert a null terminator when it needs to truncate the hostname.
@@ -312,7 +312,7 @@ static duo_code_t
312312
_duo_json_response(struct duo_ctx *ctx) {
313313
JSON_Value *json;
314314
JSON_Object *json_obj;
315-
char *p;
315+
const char *p;
316316
int code = DUO_SERVER_ERROR;
317317

318318
json = json_parse_string(ctx->body);
@@ -327,7 +327,7 @@ _duo_json_response(struct duo_ctx *ctx) {
327327
code = DUO_OK;
328328
}
329329
if (strcasecmp(p, "FAIL") == 0) {
330-
char *message;
330+
const char *message;
331331
code = json_object_get_number(json_obj, "code");
332332
// json_object_get_number will return 0 if "code" not found
333333
if (code == 0) {
@@ -351,7 +351,7 @@ _duo_https_exchange(struct duo_ctx *ctx, const char *method, const char *uri, in
351351
const int initial_backof_wait_secs = 1;
352352
const int backoff_factor = 2;
353353

354-
static const char fmt[] = "Rate-limiting response received from server. Waiting for %d seconds before retrying.";
354+
static const char fmt[] = "Rate-limiting response received from server. Waiting for %ld seconds before retrying.";
355355
char msg[(sizeof fmt) + max_int_digits];
356356
int wait_secs = initial_backof_wait_secs;
357357

@@ -375,7 +375,7 @@ _duo_https_exchange(struct duo_ctx *ctx, const char *method, const char *uri, in
375375
.tv_nsec = (float)rand() / RAND_MAX * 1000000000
376376
};
377377

378-
snprintf(msg, sizeof(msg), fmt, timeout.tv_sec);
378+
snprintf(msg, sizeof msg, fmt, (long)timeout.tv_sec);
379379
if (ctx->conv_status)
380380
ctx->conv_status(NULL, msg);
381381
nanosleep(&timeout, NULL);
@@ -475,7 +475,7 @@ _duo_preauth(struct duo_ctx *ctx, const char *username,
475475
_JSON_FIND_OBJECT(response, json_obj, "response", json);
476476
_JSON_FIND_STRING(p, response, "result", json);
477477
if (strcasecmp(p, "auth") != 0) {
478-
char *output;
478+
const char *output;
479479
_JSON_FIND_STRING(output, response, "status", json);
480480
if (strcasecmp(p, "allow") == 0) {
481481
_duo_seterr(ctx, "%s", output);

0 commit comments

Comments
 (0)