Skip to content

Commit

Permalink
Fix more warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
roehling committed Oct 19, 2014
1 parent 9548316 commit 0442b31
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 17 deletions.
3 changes: 1 addition & 2 deletions postsrsd.c
Expand Up @@ -182,7 +182,7 @@ static void handle_forward (srs_t *srs, FILE *fp, const char *address, const cha
fflush (fp);
}

static void handle_reverse (srs_t *srs, FILE *fp, const char *address, const char *domain, const char **excludes)
static void handle_reverse (srs_t *srs, FILE *fp, const char *address, const char *domain __attribute__((unused)), const char **excludes __attribute__((unused)) )
{
int result;
char value[1024];
Expand Down Expand Up @@ -340,7 +340,6 @@ int main (int argc, char **argv)
}
/* Read secret. The default installation makes this root accessible only. */
if (secret_file != NULL) {
size_t len;
sf = fopen(secret_file, "rb");
if (sf == NULL) {
fprintf (stderr, "%s: Cannot open file with secret: %s\n", self, secret_file);
Expand Down
8 changes: 4 additions & 4 deletions sha1.c
Expand Up @@ -334,7 +334,7 @@ sha_final(unsigned char digest[20], SHA_INFO *sha_info)
*/

static void
sha_digest(char *out, char *data, int len)
sha_digest(char *out, char *data, unsigned len)
{
SHA_INFO ctx;
sha_init(&ctx);
Expand All @@ -343,10 +343,10 @@ sha_digest(char *out, char *data, int len)
}

void
srs_hmac_init(srs_hmac_ctx_t *ctx, char *secret, int len)
srs_hmac_init(srs_hmac_ctx_t *ctx, char *secret, unsigned len)
{
char sbuf[SHA_BLOCKSIZE];
int i;
unsigned i;

if (len > SHA_BLOCKSIZE) {
sha_digest(sbuf, secret, len);
Expand All @@ -368,7 +368,7 @@ srs_hmac_init(srs_hmac_ctx_t *ctx, char *secret, int len)
}

void
srs_hmac_update(srs_hmac_ctx_t *ctx, char *data, int len)
srs_hmac_update(srs_hmac_ctx_t *ctx, char *data, unsigned len)
{
sha_update(&ctx->sctx, (sha_byte*)data, len);
}
Expand Down
14 changes: 7 additions & 7 deletions srs2.c
Expand Up @@ -212,7 +212,7 @@ const char *SRS_TIME_BASECHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";
#define SRS_TIME_SLOTS (1<<(SRS_TIME_BASEBITS<<(SRS_TIME_SIZE-1)))

int
srs_timestamp_create(srs_t *srs, char *buf, time_t now)
srs_timestamp_create(srs_t *srs __attribute__((unused)), char *buf, time_t now)
{
now = now / SRS_TIME_PRECISION;
buf[1] = SRS_TIME_BASECHARS[now & ((1 << SRS_TIME_BASEBITS) - 1)];
Expand Down Expand Up @@ -507,7 +507,7 @@ srs_compile_guarded(srs_t *srs,
}

int
srs_parse_shortcut(srs_t *srs, char *buf, int buflen, char *senduser)
srs_parse_shortcut(srs_t *srs, char *buf, unsigned buflen, char *senduser)
{
char *srshash;
char *srsstamp;
Expand Down Expand Up @@ -538,7 +538,7 @@ srs_parse_shortcut(srs_t *srs, char *buf, int buflen, char *senduser)
srshost, srsuser);
if (ret != SRS_SUCCESS)
return ret;
sprintf(buf, "%s@%s", srsuser, srshost);
snprintf(buf, buflen, "%s@%s", srsuser, srshost);
return SRS_SUCCESS;
}

Expand Down Expand Up @@ -577,13 +577,13 @@ srs_parse_guarded(srs_t *srs, char *buf, int buflen, char *senduser)
}

int
srs_forward(srs_t *srs, char *buf, int buflen,
srs_forward(srs_t *srs, char *buf, unsigned buflen,
const char *sender, const char *alias)
{
char *senduser;
char *sendhost;
char *tmp;
int len;
unsigned len;

if (srs->noforward)
return SRS_ENOTREWRITTEN;
Expand Down Expand Up @@ -650,11 +650,11 @@ srs_forward_alloc(srs_t *srs, char **sptr,
}

int
srs_reverse(srs_t *srs, char *buf, int buflen, const char *sender)
srs_reverse(srs_t *srs, char *buf, unsigned buflen, const char *sender)
{
char *senduser;
char *tmp;
int len;
unsigned len;

if (!SRS_IS_SRS_ADDRESS(sender))
return SRS_ENOTSRSADDRESS;
Expand Down
8 changes: 4 additions & 4 deletions srs2.h
Expand Up @@ -122,11 +122,11 @@ int srs_set_malloc(srs_malloc_t m, srs_realloc_t r, srs_free_t f);
srs_t *srs_new();
void srs_init(srs_t *srs);
void srs_free(srs_t *srs);
int srs_forward(srs_t *srs, char *buf, int buflen,
int srs_forward(srs_t *srs, char *buf, unsigned buflen,
const char *sender, const char *alias);
int srs_forward_alloc(srs_t *srs, char **sptr,
const char *sender, const char *alias);
int srs_reverse(srs_t *srs, char *buf, int buflen,
int srs_reverse(srs_t *srs, char *buf, unsigned buflen,
const char *sender);
int srs_reverse_alloc(srs_t *srs, char **sptr, const char *sender);
const char *
Expand Down Expand Up @@ -172,8 +172,8 @@ struct _srs_hmac_ctx_t {
char opad[SHA_BLOCKSIZE + 1];
} srs_hmac_ctx_t;

void srs_hmac_init(srs_hmac_ctx_t *ctx, char *secret, int len);
void srs_hmac_update(srs_hmac_ctx_t *ctx, char *data, int len);
void srs_hmac_init(srs_hmac_ctx_t *ctx, char *secret, unsigned len);
void srs_hmac_update(srs_hmac_ctx_t *ctx, char *data, unsigned len);
void srs_hmac_fini(srs_hmac_ctx_t *ctx, char *out);


Expand Down

0 comments on commit 0442b31

Please sign in to comment.