Skip to content

Commit

Permalink
fix: introduce init method and use for enroll namespace list
Browse files Browse the repository at this point in the history
  • Loading branch information
srieteja committed Dec 18, 2024
1 parent 02f6eab commit a6fd6f7
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion packages/atcommons/src/enroll_namespace.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@

#define TAG "enroll_namespace"

int atcommmons_init_enroll_namespace_list(atcommons_enroll_namespace_list_t *ns_list) {
if(ns_list == NULL) {
atlogger_log(TAG, ATLOGGER_LOGGING_LEVEL_ERROR, "Memory not allocated for namespace list struct\n");
return -1;
}

memset(ns_list, 0, sizeof(atcommons_enroll_namespace_list_t));

return 0;
}

int atcommons_enroll_namespace_list_append(atcommons_enroll_namespace_list_t **ns_list,
atcommons_enroll_namespace_t *ns) {
if (ns == NULL) {
Expand Down Expand Up @@ -134,4 +145,4 @@ int atcommons_enroll_namespace_list_from_string(atcommons_enroll_namespace_list_
pos += strlen(json_str + pos) + 1;
}
exit: { return ret; }
}
}

0 comments on commit a6fd6f7

Please sign in to comment.