Commit b0ffe9a6 authored by Julian Wiesener's avatar Julian Wiesener

use strcpy to make clang happy

parent d73f4f61
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
#include <stdint.h> #include <stdint.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <stdio.h>
#include <time.h> #include <time.h>
#include <pthread.h> #include <pthread.h>
...@@ -158,14 +157,14 @@ static int vtstor_set_key(struct vmod_vtstor_vtstor *vmi, struct vtstor_node *no ...@@ -158,14 +157,14 @@ static int vtstor_set_key(struct vmod_vtstor_vtstor *vmi, struct vtstor_node *no
return 0; return 0;
if(node->key) { if(node->key) {
if(node->key_capacity >= size) { if(node->key_capacity >= size) {
snprintf(node->key, node->key_capacity, s); strcpy(node->key, s);
return node->key_capacity; return node->key_capacity;
} }
vmi->dealloc(vmi, &node->key); vmi->dealloc(vmi, &node->key);
} }
node->key_capacity = vmi->alloc(vmi, size, &node->key); node->key_capacity = vmi->alloc(vmi, size, &node->key);
if(node->key_capacity) if(node->key_capacity)
snprintf(node->key, node->key_capacity, s); strcpy(node->key, s);
return node->key_capacity; return node->key_capacity;
} }
...@@ -178,14 +177,14 @@ static int vtstor_set_value(struct vmod_vtstor_vtstor *vmi, struct vtstor_node * ...@@ -178,14 +177,14 @@ static int vtstor_set_value(struct vmod_vtstor_vtstor *vmi, struct vtstor_node *
return 0; return 0;
if(node->value) { if(node->value) {
if(node->value_capacity >= size) { if(node->value_capacity >= size) {
snprintf(node->value, node->value_capacity, s); strcpy(node->value, s);
return node->value_capacity; return node->value_capacity;
} }
vmi->dealloc(vmi, &node->value); vmi->dealloc(vmi, &node->value);
} }
node->value_capacity = vmi->alloc(vmi, size, &node->value); node->value_capacity = vmi->alloc(vmi, size, &node->value);
if(node->value_capacity) if(node->value_capacity)
snprintf(node->value, node->value_capacity, s); strcpy(node->value, s);
return node->value_capacity; 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