summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 704a0fe)
raw | patch | inline | side by side (parent: 704a0fe)
author | Sebastian Harl <sh@tokkee.org> | |
Fri, 6 May 2016 21:47:53 +0000 (23:47 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Mon, 30 May 2016 21:44:19 +0000 (23:44 +0200) |
That is, ensure a (null-terminated!) empty string if the field is empty.
src/grpc.cc | patch | blob | history |
diff --git a/src/grpc.cc b/src/grpc.cc
index a1abe4a292d97cb8256afe475456d046b14c2167..0330aa0d5225c02e7e8852e3c3415e653ac51636 100644 (file)
--- a/src/grpc.cc
+++ b/src/grpc.cc
sstrncpy(vl->type, s.c_str(), sizeof(vl->type));
s = msg.plugin_instance();
- if (s.length())
- sstrncpy(vl->plugin_instance, s.c_str(), sizeof(vl->plugin_instance));
+ sstrncpy(vl->plugin_instance, s.c_str(), sizeof(vl->plugin_instance));
s = msg.type_instance();
- if (s.length())
- sstrncpy(vl->type_instance, s.c_str(), sizeof(vl->type_instance));
+ sstrncpy(vl->type_instance, s.c_str(), sizeof(vl->type_instance));
value_t *values = NULL;
size_t values_len = 0;
break;
default:
status = grpc::Status(grpc::StatusCode::INVALID_ARGUMENT,
- grpc::string("unkown value type"));
+ grpc::string("unknown value type"));
break;
}