diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-03-22 18:23:48 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-03-22 22:20:30 -0400 |
commit | 3c36d85db7c689cc20f480492d6ee4f43d27cbf8 (patch) | |
tree | fb06847031fbbc869bec0036e6f744c1a96e0523 /src/utils.c | |
parent | 664129de7d14bcfa4fe16e319d13a226b5087b82 (diff) | |
download | stasis-3c36d85db7c689cc20f480492d6ee4f43d27cbf8.tar.gz |
Consolidate pointer assignment to if-statement
* Easier to see what's happening. Nothing more.
Diffstat (limited to 'src/utils.c')
-rw-r--r-- | src/utils.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/utils.c b/src/utils.c index dd3dbe9..51c11e8 100644 --- a/src/utils.c +++ b/src/utils.c @@ -521,8 +521,7 @@ int path_store(char **destptr, size_t maxlen, const char *base, const char *path guard_free(*destptr); } - (*destptr) = realpath(path_tmp, NULL); - if (!*destptr) { + if (!(*destptr = realpath(path_tmp, NULL))) { goto l_path_setup_error; } @@ -638,9 +637,7 @@ int fix_tox_conf(const char *filename, char **result) { } } - if (ini_write(toxini, &fptemp)) { - guard_free(tempfile); - } + ini_write(toxini, &fptemp); fclose(fptemp); *result = tempfile; |