-/*\r
- * Copyright (c) 2025 Samsung Electronics Co., Ltd All Rights Reserved\r
- *\r
- * This file is licensed under the terms of MIT License or the Apache License\r
- * Version 2.0 of your choice. See the LICENSE.MIT file for MIT license details.\r
- * See the LICENSE file or the notice below for Apache License Version 2.0\r
- * details.\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License\r
- */\r
-/**\r
- * @file src/helpers/creds-commons/copyStr.cpp\r
- * @version 1.0\r
- * @brief Definition of copyStr()\r
- */\r
-\r
-#include <cstring>\r
-#include <cynara-error.h>\r
-#include <log/log.h>\r
-#include <string_view>\r
-\r
-// Without this attribute, the symbol gets stripped by f****** RPM and is missing after installation\r
-// even though the built shared library contains it.\r
-__attribute__((visibility("default"))) int\r
-copyStr(char** client, const std::string_view& str) noexcept {\r
- char *clientTmp = strndup(str.data(), str.size());\r
- if (!clientTmp) {\r
- LOGE("strndup failed");\r
- return CYNARA_API_OUT_OF_MEMORY;\r
- }\r
- *client = clientTmp;\r
- return CYNARA_API_SUCCESS;\r
-}\r
+/*
+ * Copyright (c) 2025 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * This file is licensed under the terms of MIT License or the Apache License
+ * Version 2.0 of your choice. See the LICENSE.MIT file for MIT license details.
+ * See the LICENSE file or the notice below for Apache License Version 2.0
+ * details.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+/**
+ * @file src/helpers/creds-commons/copyStr.cpp
+ * @version 1.0
+ * @brief Definition of copyStr()
+ */
+
+#include <cstring>
+#include <cynara-error.h>
+#include <log/log.h>
+#include <string_view>
+
+// Without this attribute, the symbol gets stripped by f****** RPM and is missing after installation
+// even though the built shared library contains it.
+__attribute__((visibility("default"))) int
+copyStr(char** client, const std::string_view& str) noexcept {
+ char *clientTmp = strndup(str.data(), str.size());
+ if (!clientTmp) {
+ LOGE("strndup failed");
+ return CYNARA_API_OUT_OF_MEMORY;
+ }
+ *client = clientTmp;
+ return CYNARA_API_SUCCESS;
+}
-/*\r
- * Copyright (c) 2025 Samsung Electronics Co., Ltd All Rights Reserved\r
- *\r
- * This file is licensed under the terms of MIT License or the Apache License\r
- * Version 2.0 of your choice. See the LICENSE.MIT file for MIT license details.\r
- * See the LICENSE file or the notice below for Apache License Version 2.0\r
- * details.\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License\r
- */\r
-/**\r
- * @file src/helpers/creds-commons/copyStr.h\r
- * @version 1.0\r
- * @brief Declaration of copyStr()\r
- */\r
-\r
-#pragma once\r
-\r
-#include <string_view>\r
-\r
-int copyStr(char** client, const std::string_view& str) noexcept;\r
+/*
+ * Copyright (c) 2025 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * This file is licensed under the terms of MIT License or the Apache License
+ * Version 2.0 of your choice. See the LICENSE.MIT file for MIT license details.
+ * See the LICENSE file or the notice below for Apache License Version 2.0
+ * details.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+/**
+ * @file src/helpers/creds-commons/copyStr.h
+ * @version 1.0
+ * @brief Declaration of copyStr()
+ */
+
+#pragma once
+
+#include <string_view>
+
+int copyStr(char** client, const std::string_view& str) noexcept;