Skip to content

Commit

Permalink
Updated the get_x_from_buffer function to make use of the length param
Browse files Browse the repository at this point in the history
  • Loading branch information
Griezn committed Aug 17, 2024
1 parent 4162d40 commit 30c2fe2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/facility.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,11 @@ stumpless_get_facility_enum_from_buffer(const char *facility_buffer, size_t faci
size_t i;
char *facility_name;
const int str_offset = 19; // to ommit "STUMPLESS_FACILITY_"
size_t buf_length;

facility_bound = sizeof( facility_enum_to_string ) /
sizeof( facility_enum_to_string[0] );

facility_name = copy_cstring_with_length(facility_buffer, &buf_length);
facility_name = copy_cstring_length(facility_buffer, facility_buffer_length);
if( !facility_name ) {
return -1;
}
Expand Down
3 changes: 1 addition & 2 deletions src/severity.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,11 @@ enum stumpless_severity stumpless_get_severity_enum_from_buffer(const char *seve
size_t i;
char *severity_name;
const int str_offset = 19; // to ommit "STUMPLESS_SEVERITY_"
size_t buf_length;

severity_bound = sizeof( severity_enum_to_string ) /
sizeof( severity_enum_to_string[0] );

severity_name = copy_cstring_with_length( severity_buffer, &buf_length );
severity_name = copy_cstring_length( severity_buffer, severity_buffer_length );
if( !severity_name ) {
return -1;
}
Expand Down

0 comments on commit 30c2fe2

Please sign in to comment.