silence compiler warnings

mostly cosmetic things
This commit is contained in:
Rainer Gerhards 2014-03-12 14:47:33 +01:00
parent c34828ca7f
commit f7ad21626f
6 changed files with 18 additions and 17 deletions

View File

@ -2,7 +2,7 @@
*
* Module begun 2011-07-01 by Rainer Gerhards
*
* Copyright 2011-2013 Rainer Gerhards and Adiscon GmbH.
* Copyright 2011-2014 Rainer Gerhards and Adiscon GmbH.
*
* This file is part of the rsyslog runtime library.
*
@ -1362,7 +1362,7 @@ doFunc_re_extract(struct cnffunc *func, struct var *ret, void* usrptr)
short matchnbr;
regmatch_t pmatch[50];
int bMustFree;
es_str_t *estr;
es_str_t *estr = NULL; /* init just to keep compiler happy */
char *str;
struct var r[CNFFUNC_MAX_ARGS];
int iLenBuf;

View File

@ -404,8 +404,8 @@ checkInstance(instanceConf_t *inst)
}
memcpy(dirn, inst->pszFileName, i); /* do not copy slash */
dirn[i] = '\0';
CHKmalloc(inst->pszFileBaseName = ustrdup(basen));
CHKmalloc(inst->pszDirName = ustrdup(dirn));
CHKmalloc(inst->pszFileBaseName = (uchar*) strdup(basen));
CHKmalloc(inst->pszDirName = (uchar*) strdup(dirn));
if(dirn[0] == '\0') {
dirn[0] = '/';

View File

@ -304,7 +304,7 @@ readjournal() {
/* ... but we know better than to trust the specs */
if (equal_sign == NULL) {
errmsg.LogError(0, RS_RET_ERR, "SD_JOURNAL_FOREACH_DATA()"
"returned a malformed field (has no '='): '%s'", get);
"returned a malformed field (has no '='): '%s'", (char*)get);
continue; /* skip the entry */
}

View File

@ -2,7 +2,7 @@
*
* An implementation of the nsd interface for GnuTLS.
*
* Copyright (C) 2007-2013 Rainer Gerhards and Adiscon GmbH.
* Copyright (C) 2007-2014 Rainer Gerhards and Adiscon GmbH.
*
* This file is part of the rsyslog runtime library.
*
@ -50,6 +50,7 @@
#include "nsd_ptcp.h"
#include "nsdsel_gtls.h"
#include "nsd_gtls.h"
#include "unicode-helper.h"
/* things to move to some better place/functionality - TODO */
#define CRLFILE "crl.pem"
@ -288,12 +289,12 @@ gtlsGetCertInfo(nsd_gtls_t *pThis, cstr_t **ppStr)
expiration_time = gnutls_x509_crt_get_expiration_time(cert);
activation_time = gnutls_x509_crt_get_activation_time(cert);
ctime_r(&activation_time, szBuf);
szBuf[strlen(szBuf) - 1] = '\0'; /* strip linefeed */
CHKiRet(rsCStrAppendStrf(pStr, (uchar*)"Certificate 1 info: "
ctime_r(&activation_time, (char*)szBuf);
szBuf[ustrlen(szBuf) - 1] = '\0'; /* strip linefeed */
CHKiRet(rsCStrAppendStrf(pStr, "Certificate 1 info: "
"certificate valid from %s ", szBuf));
ctime_r(&expiration_time, szBuf);
szBuf[strlen(szBuf) - 1] = '\0'; /* strip linefeed */
ctime_r(&expiration_time, (char*)szBuf);
szBuf[ustrlen(szBuf) - 1] = '\0'; /* strip linefeed */
CHKiRet(rsCStrAppendStrf(pStr, "to %s; ", szBuf));
/* Extract some of the public key algorithm's parameters */
@ -303,20 +304,20 @@ gtlsGetCertInfo(nsd_gtls_t *pThis, cstr_t **ppStr)
/* names */
tmp = szBufLen;
if(gnutls_x509_crt_get_dn(cert, szBuf, &tmp)
if(gnutls_x509_crt_get_dn(cert, (char*)szBuf, &tmp)
== GNUTLS_E_SHORT_MEMORY_BUFFER) {
szBufLen = tmp;
szBuf = malloc(tmp);
gnutls_x509_crt_get_dn(cert, szBuf, &tmp);
gnutls_x509_crt_get_dn(cert, (char*)szBuf, &tmp);
}
CHKiRet(rsCStrAppendStrf(pStr, "DN: %s; ", szBuf));
tmp = szBufLen;
if(gnutls_x509_crt_get_issuer_dn(cert, szBuf, &tmp)
if(gnutls_x509_crt_get_issuer_dn(cert, (char*)szBuf, &tmp)
== GNUTLS_E_SHORT_MEMORY_BUFFER) {
szBufLen = tmp;
szBuf = realloc((szBuf == szBufA) ? NULL : szBuf, tmp);
gnutls_x509_crt_get_issuer_dn(cert, szBuf, &tmp);
gnutls_x509_crt_get_issuer_dn(cert, (char*)szBuf, &tmp);
}
CHKiRet(rsCStrAppendStrf(pStr, "Issuer DN: %s; ", szBuf));

View File

@ -309,7 +309,7 @@ rsRetVal cstrAppendCStr(cstr_t *pThis, cstr_t *pstrAppend)
/* append a printf-style formated string
*/
rsRetVal rsCStrAppendStrf(cstr_t *pThis, uchar *fmt, ...)
rsRetVal rsCStrAppendStrf(cstr_t *pThis, char *fmt, ...)
{
DEFiRet;
va_list ap;

View File

@ -178,7 +178,7 @@ rsRetVal rsCStrAppendStrWithLen(cstr_t *pThis, uchar* psz, size_t iStrLen);
*
* \param fmt pointer to the format string (see man 3 printf for details). Must not be NULL.
*/
rsRetVal rsCStrAppendStrf(cstr_t *pThis, uchar *fmt, ...);
rsRetVal rsCStrAppendStrf(cstr_t *pThis, char *fmt, ...) __attribute__((format(printf,2, 3)));
/**
* Append an integer to the string. No special formatting is