Skip to content

Commit

Permalink
Fix added for a description crash bug in the buffers
Browse files Browse the repository at this point in the history
  • Loading branch information
LimpingNinja committed Mar 28, 2020
1 parent e639591 commit b1f7931
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/misc/time
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
hour : 16
day_of_week : 0
day_of_month: 0
hour : 4
day_of_week : 2
day_of_month: 2
month : 0
year : 8
-
4 changes: 3 additions & 1 deletion src/buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,9 @@ int bufferReplace(BUFFER *buf, const char *a, const char *b, int all) {
return 0;

// if we won't have enough room, do the expansion
if(to_replace * (b_len - a_len) + buf->len > buf->maxlen)
// Description crashbug - fix added based on old forum trawling:
// http://www.mudbytes.net/forum/comment/51178/
if(to_replace * (b_len - a_len) + buf->len >= buf->maxlen)
len_needed = ((buf->maxlen + to_replace*(b_len-a_len))*5)/4 + 20;
}

Expand Down

0 comments on commit b1f7931

Please sign in to comment.