From a261dcd87ae978da4ff5e910dda8127097d04045 Mon Sep 17 00:00:00 2001
From: Andreas Rogge <andreas.rogge@bareos.com>
Date: Mon, 15 Jul 2019 09:52:29 +0200
Subject: [PATCH 2/2] tests: fix format-string problem

Fixes #1072: 18.2.6 build error on tests
---
 core/src/tests/lib_tests.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/core/src/tests/lib_tests.cc b/core/src/tests/lib_tests.cc
index f76cef3..fc7e7a5 100644
--- a/core/src/tests/lib_tests.cc
+++ b/core/src/tests/lib_tests.cc
@@ -186,7 +186,7 @@ static void do_get_name_from_hello_test(const char* client_string_fmt,
                                         const BareosVersionNumber& version_test)
 {
   char bashed_client_name[20];
-  sprintf(bashed_client_name, client_name);
+  strncpy(bashed_client_name, client_name, 20);
   BashSpaces(bashed_client_name);
 
   char output_text[64];
-- 
1.8.3.1

