Skip to content

Commit

Permalink
API documentation revised and local variables renamed based on code r…
Browse files Browse the repository at this point in the history
…eview comments.
  • Loading branch information
PengZheng committed Aug 18, 2023
1 parent b17c9e4 commit 779e73a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions libs/framework/src/manifest.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,12 @@ celix_status_t manifest_read(manifest_pt manifest, const char *filename) {
}

celix_status_t manifest_readFromStream(manifest_pt manifest, FILE* stream) {
char lbuf[512];
char *bytes = lbuf;
char stackBuf[512];
char *bytes = stackBuf;

// get file size
if(fseek(stream, 0L, SEEK_END) == -1) {
return CELIX_ERROR_MAKE(CELIX_FACILITY_CERRNO,errno);
if (fseek(stream, 0L, SEEK_END) == -1) {
return CELIX_ERROR_MAKE(CELIX_FACILITY_CERRNO, errno);
}
long int size = ftell(stream);
if (size < 0) {
Expand All @@ -177,10 +177,10 @@ celix_status_t manifest_readFromStream(manifest_pt manifest, FILE* stream) {
}
rewind(stream);

celix_autofree char* largeBuf = NULL;
if (size+1 > sizeof(lbuf)) {
largeBuf = bytes = malloc(size+1);
if (largeBuf == NULL) {
celix_autofree char* heapBuf = NULL;
if (size+1 > sizeof(stackBuf)) {
heapBuf = bytes = malloc(size+1);
if (heapBuf == NULL) {
celix_err_pushf("Manifest error: failed to allocate %ld bytes", size);
return CELIX_ENOMEM;
}
Expand Down
2 changes: 1 addition & 1 deletion libs/utils/include/celix_err.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ CELIX_UTILS_EXPORT void celix_err_printErrors(FILE* stream, const char* prefix,

/**
* @brief Dump error messages from the current thread to the provided buffer.
* @param[in] buf The buffer to dump the error messages to.
* @param[in,out] buf The buffer to dump the error messages to.
* @param[in] size The size of the buffer.
* @param[in] prefix The prefix to print before each error message. If NULL no prefix is printed.
* @param[in] postfix The postfix to print after each error message. If NULL, a '\n' postfix is printed.
Expand Down

0 comments on commit 779e73a

Please sign in to comment.