projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Treewide: use bool instead of _Bool
[collectd.git]
/
src
/
libcollectdclient
/
network_buffer.c
diff --git
a/src/libcollectdclient/network_buffer.c
b/src/libcollectdclient/network_buffer.c
index
662265d
..
755d476
100644
(file)
--- a/
src/libcollectdclient/network_buffer.c
+++ b/
src/libcollectdclient/network_buffer.c
@@
-30,6
+30,7
@@
#include <assert.h>
#include <errno.h>
#include <math.h>
#include <assert.h>
#include <errno.h>
#include <math.h>
+#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <stdlib.h>
#include <string.h>
@@
-122,10
+123,10
@@
struct lcc_network_buffer_s {
/*
* Private functions
*/
/*
* Private functions
*/
-static
_B
ool have_gcrypt(void) /* {{{ */
+static
b
ool have_gcrypt(void) /* {{{ */
{
{
- static
_B
ool result = 0;
- static
_B
ool need_init = 1;
+ static
b
ool result = 0;
+ static
b
ool need_init = 1;
if (!need_init)
return result;
if (!need_init)
return result;
@@
-150,7
+151,7
@@
static _Bool have_gcrypt(void) /* {{{ */
#else
return 0;
#endif
#else
return 0;
#endif
-} /* }}}
_B
ool have_gcrypt */
+} /* }}}
b
ool have_gcrypt */
#ifndef HAVE_HTONLL
static uint64_t htonll(uint64_t val) /* {{{ */
#ifndef HAVE_HTONLL
static uint64_t htonll(uint64_t val) /* {{{ */
@@
-255,6
+256,10
@@
static double htond(double val) /* {{{ */
static int nb_add_values(char **ret_buffer, /* {{{ */
size_t *ret_buffer_len, const lcc_value_list_t *vl) {
static int nb_add_values(char **ret_buffer, /* {{{ */
size_t *ret_buffer_len, const lcc_value_list_t *vl) {
+ if ((vl == NULL) || (vl->values_len < 1)) {
+ return EINVAL;
+ }
+
char *packet_ptr;
size_t packet_len;
char *packet_ptr;
size_t packet_len;