Loading src/or/buffers.c +3 −9 Original line number Diff line number Diff line Loading @@ -291,15 +291,9 @@ int write_to_buf(const char *string, int string_len, buf_t *buf) { assert(string && BUF_OK(buf)); if (buf_ensure_capacity(buf, buf->datalen+string_len)) log_fn(LOG_WARN, "buflen too small, can't hold %d bytes.",buf->datalen+string_len); return -1; /* this is the point where you would grow the buffer, if you want to */ if (string_len + buf->datalen > buf->len) { /* we're out of luck */ log_fn(LOG_WARN, "buflen too small. Time to implement growing dynamic bufs."); return -1; } memcpy(buf->mem+buf->datalen, string, string_len); buf->datalen += string_len; log_fn(LOG_DEBUG,"added %d bytes to buf (now %d total).",string_len, (int)buf->datalen); Loading Loading
src/or/buffers.c +3 −9 Original line number Diff line number Diff line Loading @@ -291,15 +291,9 @@ int write_to_buf(const char *string, int string_len, buf_t *buf) { assert(string && BUF_OK(buf)); if (buf_ensure_capacity(buf, buf->datalen+string_len)) log_fn(LOG_WARN, "buflen too small, can't hold %d bytes.",buf->datalen+string_len); return -1; /* this is the point where you would grow the buffer, if you want to */ if (string_len + buf->datalen > buf->len) { /* we're out of luck */ log_fn(LOG_WARN, "buflen too small. Time to implement growing dynamic bufs."); return -1; } memcpy(buf->mem+buf->datalen, string, string_len); buf->datalen += string_len; log_fn(LOG_DEBUG,"added %d bytes to buf (now %d total).",string_len, (int)buf->datalen); Loading