projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Various plugins: Use the IS_TRUE and IS_FALSE macros everywhere.
[collectd.git]
/
src
/
ascent.c
diff --git
a/src/ascent.c
b/src/ascent.c
index
54341c7
..
6782fce
100644
(file)
--- a/
src/ascent.c
+++ b/
src/ascent.c
@@
-174,7
+174,7
@@
static size_t ascent_curl_callback (void *buf, size_t size, size_t nmemb, /* {{{
static int ascent_submit_players (player_stats_t *ps) /* {{{ */
{
static int ascent_submit_players (player_stats_t *ps) /* {{{ */
{
-
in
t i;
+
size_
t i;
gauge_t value;
for (i = 0; i < RACES_LIST_LENGTH; i++)
gauge_t value;
for (i = 0; i < RACES_LIST_LENGTH; i++)
@@
-213,7
+213,7
@@
static int ascent_account_player (player_stats_t *ps, /* {{{ */
{
if (pi->race >= 0)
{
{
if (pi->race >= 0)
{
- if ((pi->race >= RACES_LIST_LENGTH)
+ if ((
(size_t)
pi->race >= RACES_LIST_LENGTH)
|| (races_list[pi->race] == NULL))
ERROR ("ascent plugin: Ignoring invalid numeric race %i.", pi->race);
else
|| (races_list[pi->race] == NULL))
ERROR ("ascent plugin: Ignoring invalid numeric race %i.", pi->race);
else
@@
-222,7
+222,7
@@
static int ascent_account_player (player_stats_t *ps, /* {{{ */
if (pi->class >= 0)
{
if (pi->class >= 0)
{
- if ((pi->class >= CLASSES_LIST_LENGTH)
+ if ((
(size_t)
pi->class >= CLASSES_LIST_LENGTH)
|| (classes_list[pi->class] == NULL))
ERROR ("ascent plugin: Ignoring invalid numeric class %i.", pi->class);
else
|| (classes_list[pi->class] == NULL))
ERROR ("ascent plugin: Ignoring invalid numeric class %i.", pi->class);
else
@@
-231,7
+231,7
@@
static int ascent_account_player (player_stats_t *ps, /* {{{ */
if (pi->gender >= 0)
{
if (pi->gender >= 0)
{
- if ((pi->gender >= GENDERS_LIST_LENGTH)
+ if ((
(size_t)
pi->gender >= GENDERS_LIST_LENGTH)
|| (genders_list[pi->gender] == NULL))
ERROR ("ascent plugin: Ignoring invalid numeric gender %i.",
pi->gender);
|| (genders_list[pi->gender] == NULL))
ERROR ("ascent plugin: Ignoring invalid numeric gender %i.",
pi->gender);
@@
-549,7
+549,7
@@
static int ascent_init (void) /* {{{ */
status = ssnprintf (credentials, sizeof (credentials), "%s:%s",
user, (pass == NULL) ? "" : pass);
status = ssnprintf (credentials, sizeof (credentials), "%s:%s",
user, (pass == NULL) ? "" : pass);
- if (
status >= sizeof (credentials
))
+ if (
(status < 0) || ((size_t) status >= sizeof (credentials)
))
{
ERROR ("ascent plugin: ascent_init: Returning an error because the "
"credentials have been truncated.");
{
ERROR ("ascent plugin: ascent_init: Returning an error because the "
"credentials have been truncated.");
@@
-560,13
+560,14
@@
static int ascent_init (void) /* {{{ */
}
curl_easy_setopt (curl, CURLOPT_URL, url);
}
curl_easy_setopt (curl, CURLOPT_URL, url);
+ curl_easy_setopt (curl, CURLOPT_FOLLOWLOCATION, 1);
- if ((verify_peer == NULL) ||
(strcmp (verify_peer, "true") == 0
))
+ if ((verify_peer == NULL) ||
IS_TRUE (verify_peer
))
curl_easy_setopt (curl, CURLOPT_SSL_VERIFYPEER, 1);
else
curl_easy_setopt (curl, CURLOPT_SSL_VERIFYPEER, 0);
curl_easy_setopt (curl, CURLOPT_SSL_VERIFYPEER, 1);
else
curl_easy_setopt (curl, CURLOPT_SSL_VERIFYPEER, 0);
- if ((verify_host == NULL) ||
(strcmp (verify_host, "true") == 0
))
+ if ((verify_host == NULL) ||
IS_TRUE (verify_host
))
curl_easy_setopt (curl, CURLOPT_SSL_VERIFYHOST, 2);
else
curl_easy_setopt (curl, CURLOPT_SSL_VERIFYHOST, 0);
curl_easy_setopt (curl, CURLOPT_SSL_VERIFYHOST, 2);
else
curl_easy_setopt (curl, CURLOPT_SSL_VERIFYHOST, 0);