Skip to content

Commit

Permalink
Merge pull request #25 from m-kress/master
Browse files Browse the repository at this point in the history
Cosmetics: Add missing brackets to harmonize code
  • Loading branch information
m-kress authored Jul 6, 2023
2 parents 7497fe3 + 0289f2b commit 402dfce
Show file tree
Hide file tree
Showing 3 changed files with 266 additions and 116 deletions.
35 changes: 35 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,38 @@
* Version (not released, yet)
- m-kress:
-- add missing brackets to harmonize code
- auouymous:
-- fix behavior of (program_)?regex and (program_)?neg_regex conditions
- LonEox78:
-- pointer to directory name was not initialized, so eventually weird directories were created
- orbea:
-- replace RETSIGTYPE with void
-- silence obsolete warnings

* Version 20220214
- jovanlanik:
-- port to pcre2
-- doku has been updated, removed a lot of inconsistencies
-- add an option to change group
-- add permissions to configuration
-- remove unused errptr

* Version 20200113
- avoid writing logs to STDOUT twice
- add line feed to sent UDP log entries
- rkonrad:
-- add support for nanoseconds in time stamp

* Version 20181125
- closed memory leaks for remote syslog

* Version 2018510
- orbea:
-- clean up automake files

* Version 20180327
- minor fix in man page

* Version 20180326
- moved to GitHub hvisage/metalog
- Michael Kress:
Expand Down
12 changes: 8 additions & 4 deletions src/helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,32 +32,36 @@ static pcre2_code *wpcre2_compile(const char *pattern, uint32_t options)
static void *wmalloc(size_t size)
{
void *ret = malloc(size);
if (!ret)
if (!ret) {
warnp("malloc(%zu) failed", size);
}
return ret;
}

static void *wrealloc(void *ptr, size_t size)
{
void *ret = realloc(ptr, size);
if (!ret)
if (!ret) {
warnp("realloc(%p, %zu) failed", ptr, size);
}
return ret;
}

static char *wstrdup(const char *s)
{
char *ret = strdup(s);
if (!ret)
if (!ret) {
warnp("strdup(\"%s\") failed", s);
}
return ret;
}

static char *xstrdup(const char *s)
{
char *ret = strdup(s);
if (!ret)
if (!ret) {
errp("strdup(\"%s\") failed", s);
}
return ret;
}

Expand Down
Loading

0 comments on commit 402dfce

Please sign in to comment.