mirror of
https://github.com/profanity-im/profanity.git
synced 2024-12-04 14:46:46 -05:00
Use PAD_SIZE for buffer max size
This commit is contained in:
parent
78b0388b6c
commit
bf62d8bd65
@ -61,7 +61,7 @@ buffer_push(ProfBuff buffer, const char show_char, const char * const date_fmt,
|
|||||||
e->message = malloc(strlen(message)+1);
|
e->message = malloc(strlen(message)+1);
|
||||||
strcpy(e->message, message);
|
strcpy(e->message, message);
|
||||||
|
|
||||||
if (g_slist_length(buffer->entries) == BUFF_SIZE) {
|
if (g_slist_length(buffer->entries) == PAD_SIZE) {
|
||||||
_free_entry(buffer->entries->data);
|
_free_entry(buffer->entries->data);
|
||||||
buffer->entries = g_slist_delete_link(buffer->entries, buffer->entries);
|
buffer->entries = g_slist_delete_link(buffer->entries, buffer->entries);
|
||||||
}
|
}
|
||||||
|
@ -3,8 +3,6 @@
|
|||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#define BUFF_SIZE 1000
|
|
||||||
|
|
||||||
typedef struct prof_buff_entry_t {
|
typedef struct prof_buff_entry_t {
|
||||||
char show_char;
|
char show_char;
|
||||||
char *date_fmt;
|
char *date_fmt;
|
||||||
|
Loading…
Reference in New Issue
Block a user