Blob Blame History Raw
From 04ec438941a11c162314c906af2f955166a64e8d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ha=C3=AFkel=20Gu=C3=A9mar?= <hguemar@fedoraproject.org>
Date: Sun, 11 May 2014 15:05:53 +0200
Subject: [PATCH] fix FTBFS with Werror=format-security

---
 src/utils/ORBTools.cc | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/utils/ORBTools.cc b/src/utils/ORBTools.cc
index 762dd4c..4b4134d 100644
--- a/src/utils/ORBTools.cc
+++ b/src/utils/ORBTools.cc
@@ -197,10 +197,10 @@ ORBTools::registerServant(const char* contextName, const char* contextKind,
     context.length(1);
     size_t sz1 = strlen(contextName) + 1;
     context[0].id = new char[sz1];
-    snprintf(context[0].id, sz1,  contextName);
+    strncpy(context[0].id, contextName, sz1);
     size_t sz2 = strlen(contextKind) + 1;
     context[0].kind = new char[sz2];
-    snprintf(context[0].kind, sz2, contextKind);
+    strncpy(context[0].kind, contextKind, sz2);
     CosNaming::NamingContext_var testContext;
     try {
       testContext = rootContext->bind_new_context(context);
@@ -217,10 +217,10 @@ ORBTools::registerServant(const char* contextName, const char* contextKind,
     object.length(1);
     sz1 = strlen(name) + 1;
     object[0].id   = new char[sz1];
-    snprintf(object[0].id, sz1, name);
+    strncpy(object[0].id, name, sz1);
     sz2 = strlen(kind) + 1;
     object[0].kind = new char[sz2];
-    snprintf(object[0].kind, sz2, kind);
+    strncpy(object[0].kind, kind, sz2);
 
     try {
       testContext->bind(object, objref);
-- 
1.9.0