diff options
| author | John Keeping <[email protected]> | 2016-02-08 14:12:35 +0000 |
|---|---|---|
| committer | Jason A. Donenfeld <[email protected]> | 2016-02-08 17:27:38 +0000 |
| commit | bdcbe0922d7099ebd61d875709ea9408bc1d7543 (patch) | |
| tree | df225a74a832eb528e0686d6286bd8a5282eb633 /ui-commit.c | |
| parent | ui-stats: if we're going to abuse void*, do it safely (diff) | |
| download | cgit-bdcbe0922d7099ebd61d875709ea9408bc1d7543.tar.gz cgit-bdcbe0922d7099ebd61d875709ea9408bc1d7543.zip | |
ui-stats: cast pointer before checking for zero
We abuse the "void *util" field as a counter and recently started to
cast it to a uintptr_t to avoid risking nasal demons by performing
arithmetic on a void pointer.
However, compilers are also known to do "interesting" things if they
know that a pointer is or isn't NULL. Make this safer by checking if
the counter (after casting) is non-zero rather than checking if the
pointer is non-null.
Signed-off-by: John Keeping <[email protected]>
Diffstat (limited to 'ui-commit.c')
0 files changed, 0 insertions, 0 deletions
