additional error checking
This commit is contained in:
parent
7fcb2addfe
commit
5ef447c629
@ -22,4 +22,9 @@ typedef enum {
|
||||
*/
|
||||
#define goto_if_error(r, l) do { if (ED_ERROR(r)) goto l; } while(0)
|
||||
|
||||
/**
|
||||
* Return `r` if `b` is true.
|
||||
*/
|
||||
#define return_if_true(b, r) do { if (b) return r; } while(0)
|
||||
|
||||
#endif
|
||||
|
@ -63,6 +63,9 @@ EDErrorCode ed_journal_file_parse(EDJournalFile *file, char const *filename)
|
||||
gchar *timestamp = NULL;
|
||||
gchar *index = NULL;
|
||||
|
||||
return_if_true(file == NULL, ed_error_args);
|
||||
return_if_true(S_EMPTY(filename), ed_error_args);
|
||||
|
||||
new_style = g_regex_new(
|
||||
"Journal\\.([\\dT\\-]+)\\.(\\d+)\\.log",
|
||||
0, 0, NULL
|
||||
|
Loading…
x
Reference in New Issue
Block a user