Skip to content

Commit

Permalink
Cosmetics: Add missing brackets to harmonize code; No functionality h…
Browse files Browse the repository at this point in the history
…as been changed
  • Loading branch information
m-kress committed Jul 3, 2023
1 parent 7497fe3 commit 48408c0
Show file tree
Hide file tree
Showing 2 changed files with 231 additions and 116 deletions.
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 48408c0

Please sign in to comment.