Skip to content

Commit f27fa98

Browse files
committed
Some minor changes
* Fix some linter suggestions. * Change some defines to `const` vars. * Free buffer entries in the reverse order they were allocated. Signed-off-by: Steffen Jaeckel <[email protected]>
1 parent 8151dfa commit f27fa98

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

src/ui/buffer.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -213,12 +213,12 @@ _create_entry(const char* show_char, int pad_indent, GDateTime* time, int flags,
213213
static void
214214
_free_entry(ProfBuffEntry* entry)
215215
{
216-
free(entry->show_char);
216+
free(entry->id);
217217
free(entry->message);
218-
free(entry->display_from);
219218
free(entry->from_jid);
220-
free(entry->id);
221-
free(entry->receipt);
219+
free(entry->display_from);
222220
g_date_time_unref(entry->time);
221+
free(entry->show_char);
222+
free(entry->receipt);
223223
free(entry);
224224
}

src/ui/window.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,11 @@
6161
#include "ui/screen.h"
6262
#include "xmpp/xmpp.h"
6363
#include "xmpp/roster_list.h"
64-
#include "xmpp/connection.h"
65-
#include "database.h"
6664

67-
#define PAD_SIZE 1000
68-
#define LOADING_MESSAGE "Loading older messages…"
69-
#define CONS_WIN_TITLE "Profanity. Type /help for help information."
70-
#define XML_WIN_TITLE "XML Console"
65+
static const int PAD_SIZE = 100;
66+
static const char* LOADING_MESSAGE = "Loading older messages…";
67+
static const char* CONS_WIN_TITLE = "Profanity. Type /help for help information.";
68+
static const char* XML_WIN_TITLE = "XML Console";
7169

7270
#define CEILING(X) (X - (int)(X) > 0 ? (int)(X + 1) : (int)(X))
7371

0 commit comments

Comments
 (0)