#define BUFFER_ADD(dest, src) do { \
size_t dest_size = sizeof (dest); \
strncat ((dest), (src), dest_size - strlen (dest)); \
- (dest)[dest_size - 1] = 0; \
+ (dest)[dest_size - 1] = '\0'; \
} while (0)
static int
size_t i;
int status;
+ key[0] = '\0';
memcpy(buffer, number_val, number_len);
- buffer[sizeof(buffer) - 1] = 0;
+ buffer[sizeof(buffer) - 1] = '\0';
- memset (key, 0, sizeof (key));
for (i = 0; i < state->depth; i++)
{
if (state->stack[i] == NULL)
{
uint32_t type;
char ds_name[DATA_MAX_NAME_LEN];
- memset(ds_name, 0, sizeof(ds_name));
if(convert_special_metrics)
{
static int cc_add_daemon_config(oconfig_item_t *ci)
{
int ret, i;
- struct ceph_daemon *nd, cd;
+ struct ceph_daemon *nd, cd = { 0 };
struct ceph_daemon **tmp;
- memset(&cd, 0, sizeof(struct ceph_daemon));
if((ci->values_num != 1) || (ci->values[0].type != OCONFIG_TYPE_STRING))
{
int index = vtmp->index;
char ds_name[DATA_MAX_NAME_LEN];
- memset(ds_name, 0, sizeof(ds_name));
if (parse_keys (ds_name, sizeof (ds_name), key))
{
static int cconn_connect(struct cconn *io)
{
- struct sockaddr_un address;
+ struct sockaddr_un address = { 0 };
int flags, fd, err;
if(io->state != CSTATE_UNCONNECTED)
{
"failed: error %d", err);
return err;
}
- memset(&address, 0, sizeof(struct sockaddr_un));
address.sun_family = AF_UNIX;
snprintf(address.sun_path, sizeof(address.sun_path), "%s",
io->d->asok_path);