Skip to content

Commit

Permalink
Some missing error propagation
Browse files Browse the repository at this point in the history
  • Loading branch information
attipaci committed Dec 11, 2024
1 parent 9b89be8 commit dd70771
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/xchange.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@ int xElementSizeOf(XType type) {
case X_FIELD: return sizeof(XField);
}

x_error(0, EINVAL, "xElementSizeOf", "invalid type: %d ('%c')", type, type);
return 0;
}

Expand Down
5 changes: 4 additions & 1 deletion src/xstruct.c
Original file line number Diff line number Diff line change
Expand Up @@ -1025,7 +1025,10 @@ char *xCopyIDToken(const char *id) {
char *token;
int l;

if(!id) return NULL;
if(!id) {
x_error(X_NULL, EINVAL, "xCopyIDToken", "input ID is NULL");
return NULL;
}

// Ignore leading separator.
if(!strncmp(id, X_SEP, X_SEP_LENGTH)) id += X_SEP_LENGTH;
Expand Down

0 comments on commit dd70771

Please sign in to comment.