Commit b0ffe9a6 authored by Julian Wiesener's avatar Julian Wiesener

use strcpy to make clang happy

parent d73f4f61
......@@ -29,7 +29,6 @@
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <time.h>
#include <pthread.h>
......@@ -158,14 +157,14 @@ static int vtstor_set_key(struct vmod_vtstor_vtstor *vmi, struct vtstor_node *no
return 0;
if(node->key) {
if(node->key_capacity >= size) {
snprintf(node->key, node->key_capacity, s);
strcpy(node->key, s);
return node->key_capacity;
}
vmi->dealloc(vmi, &node->key);
}
node->key_capacity = vmi->alloc(vmi, size, &node->key);
if(node->key_capacity)
snprintf(node->key, node->key_capacity, s);
strcpy(node->key, s);
return node->key_capacity;
}
......@@ -178,14 +177,14 @@ static int vtstor_set_value(struct vmod_vtstor_vtstor *vmi, struct vtstor_node *
return 0;
if(node->value) {
if(node->value_capacity >= size) {
snprintf(node->value, node->value_capacity, s);
strcpy(node->value, s);
return node->value_capacity;
}
vmi->dealloc(vmi, &node->value);
}
node->value_capacity = vmi->alloc(vmi, size, &node->value);
if(node->value_capacity)
snprintf(node->value, node->value_capacity, s);
strcpy(node->value, s);
return node->value_capacity;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment