From b6ba3a070dc17cdd4ee7286409655aeef7d2bbb5 Mon Sep 17 00:00:00 2001 From: Joe Thornber Date: Wed, 13 Jun 2018 12:50:48 +0100 Subject: [PATCH] [restore_emitter] squash a strncpy warning --- caching/restore_emitter.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/caching/restore_emitter.cc b/caching/restore_emitter.cc index b7a573f..5c30b9f 100644 --- a/caching/restore_emitter.cc +++ b/caching/restore_emitter.cc @@ -26,7 +26,7 @@ namespace { superblock &sb = md_->sb_; sb.version = metadata_version_; - strncpy((char *) sb.policy_name, policy.c_str(), sizeof(sb.policy_name)); + strncpy((char *) sb.policy_name, policy.c_str(), sizeof(sb.policy_name) - 1); memset(sb.policy_version, 0, sizeof(sb.policy_version)); // FIXME: should come from xml sb.policy_hint_size = hint_width; md_->setup_hint_array(hint_width);