X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fascent.c;h=9124c26df96fa937215d5c2db40444baab3cda2a;hb=c6557cb8950f50a41a1decfb34439b060e2fd371;hp=2ba3c772d5f9f8116f4100b6f3484756cfbb8ef7;hpb=b758f3b7146f1497d93e1df64cbc0c14ae164768;p=collectd.git diff --git a/src/ascent.c b/src/ascent.c index 2ba3c772..9124c26d 100644 --- a/src/ascent.c +++ b/src/ascent.c @@ -32,7 +32,7 @@ #include #include -static char *races_list[] = /* {{{ */ +static const char *races_list[] = /* {{{ */ { NULL, "Human", /* 1 */ @@ -49,7 +49,7 @@ static char *races_list[] = /* {{{ */ }; /* }}} */ #define RACES_LIST_LENGTH STATIC_ARRAY_SIZE (races_list) -static char *classes_list[] = /* {{{ */ +static const char *classes_list[] = /* {{{ */ { NULL, "Warrior", /* 1 */ @@ -66,7 +66,7 @@ static char *classes_list[] = /* {{{ */ }; /* }}} */ #define CLASSES_LIST_LENGTH STATIC_ARRAY_SIZE (classes_list) -static char *genders_list[] = /* {{{ */ +static const char *genders_list[] = /* {{{ */ { "Male", "Female" @@ -154,14 +154,14 @@ static size_t ascent_curl_callback (void *buf, size_t size, size_t nmemb, /* {{{ { size_t len = size * nmemb; - if (len <= 0) + if (len == 0) return (len); if ((ascent_buffer_fill + len) >= ascent_buffer_size) { char *temp; - temp = (char *) realloc (ascent_buffer, + temp = realloc (ascent_buffer, ascent_buffer_fill + len + 1); if (temp == NULL) {