| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -282,9 +282,12 @@ Buffer<void> DataPointer::release() { | |||
| 282 | 282 | } | |
| 283 | 283 | ||
| 284 | 284 | DataPointer DataPointer::resize(size_t len) { | |
| 285 | - size_t actual_len = std::min(len_, len); | ||
| 285 | + const size_t actual_len = std::min(len_, len); | ||
| 286 | + if (actual_len == len_) return std::move(*this); | ||
| 287 | + | ||
| 286 | 288 | auto buf = release(); | |
| 287 | - if (actual_len == len_) return DataPointer(buf.data, actual_len); | ||
| 289 | + if (actual_len == 0) return DataPointer(buf.data, actual_len); | ||
| 290 | + | ||
| 288 | 291 | buf.data = OPENSSL_realloc(buf.data, actual_len); | |
| 289 | 292 | buf.len = actual_len; | |
| 290 | 293 | return DataPointer(buf); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments