This is an automated email from the ASF dual-hosted git repository.

erjanaltena pushed a commit to branch bugfix/fix_gcc12_errors
in repository https://gitbox.apache.org/repos/asf/celix.git


The following commit(s) were added to refs/heads/bugfix/fix_gcc12_errors by 
this push:
     new bc2e8d2a Fix gcc-12 compiler errors
bc2e8d2a is described below

commit bc2e8d2ae1d8b976168e114d9146be91fd746048
Author: Erjan Altena <[email protected]>
AuthorDate: Mon Sep 19 20:32:30 2022 +0200

    Fix gcc-12 compiler errors
---
 libs/dfi/src/dyn_avpr_type.c        | 6 +++---
 libs/framework/src/bundle_archive.c | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/libs/dfi/src/dyn_avpr_type.c b/libs/dfi/src/dyn_avpr_type.c
index 64121a31..c485b590 100644
--- a/libs/dfi/src/dyn_avpr_type.c
+++ b/libs/dfi/src/dyn_avpr_type.c
@@ -348,7 +348,7 @@ static dyn_type * dynAvprType_parseRecord(dyn_type * root, 
dyn_type * parent, js
     // Create namespace + name for storage in type->name (to preserve 
namespacing)
     char fqn_buffer[FQN_SIZE];
     snprintf(fqn_buffer, FQN_SIZE, "%s.%s", record_ns, 
json_string_value(json_object_get(record_obj, "name")));
-    type->name = strndup(fqn_buffer, STR_LENGTH);
+    type->name = strndup(fqn_buffer, FQN_SIZE);
     if (!type->name) {
         LOG_ERROR("Record: failed to allocate memory for type->name");
         dynType_destroy(type);
@@ -1010,13 +1010,13 @@ static inline void 
dynAvprType_createVersionMetaEntry(dyn_type * type, json_t co
             version_destroy(v);
         }
         else {
-            m_entry->value = strndup("0.0.0", STR_LENGTH);
+            m_entry->value = strdup("0.0.0");
             LOG_WARNING("parseAvpr: Did not find valid version, set version to 
0.0.0");
         }
     }
     else {
         // If no version or an invalid version is available, default to 0.0.0
-        m_entry->value = strndup("0.0.0", STR_LENGTH);
+        m_entry->value = strdup("0.0.0");
         LOG_WARNING("parseAvpr: Did not find version entry, set version to 
0.0.0");
     }
 
diff --git a/libs/framework/src/bundle_archive.c 
b/libs/framework/src/bundle_archive.c
index 80d53607..e4448c7b 100644
--- a/libs/framework/src/bundle_archive.c
+++ b/libs/framework/src/bundle_archive.c
@@ -73,7 +73,7 @@ celix_status_t 
bundleArchive_createSystemBundleArchive(bundle_archive_pt *bundle
                        status = linkedList_create(&archive->revisions);
                        if (status == CELIX_SUCCESS) {
                                archive->id = CELIX_FRAMEWORK_BUNDLE_ID;
-                               archive->location = strndup("System Bundle", 
1024);
+                               archive->location = strdup("System Bundle");
                                archive->archiveRoot = NULL;
                                archive->archiveRootDir = NULL;
                                archive->refreshCount = -1;

Reply via email to