mirror of
https://github.com/red0124/ssp.git
synced 2025-01-23 04:55:20 +01:00
[skip ci] Update ssp.hpp
This commit is contained in:
parent
f4a06d40e7
commit
b3f3bdf8d1
5
ssp.hpp
5
ssp.hpp
@ -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;
|
||||
}
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user