Skip to content

Commit

Permalink
[skip ci] Update ssp.hpp
Browse files Browse the repository at this point in the history
  • Loading branch information
red0124 committed Feb 25, 2024
1 parent f4a06d4 commit b3f3bdf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ssp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ ssize_t get_line_file(char** lineptr, size_t* n, FILE* fp) {

if (*lineptr == nullptr || *n < sizeof(buff)) {
size_t new_n = sizeof(buff);
lineptr = static_cast<char*>(strict_realloc(*lineptr, new_n));
*lineptr = static_cast<char*>(strict_realloc(*lineptr, new_n));
*n = new_n;
}

Expand All @@ -680,7 +680,8 @@ ssize_t get_line_file(char** lineptr, size_t* n, FILE* fp) {

if (*n <= buff_used + line_used) {
size_t new_n = *n * 2;
lineptr = static_cast<char*>(realloc(*lineptr, new_n));

*lineptr = static_cast<char*>(strict_realloc(*lineptr, new_n));
*n = new_n;
}

Expand Down

0 comments on commit b3f3bdf

Please sign in to comment.