diff options
author | Runxi Yu <me@runxiyu.org> | 1970-01-01 00:00:00 +0000 |
---|---|---|
committer | Test_User <hax@andrewyu.org> | 2024-07-24 01:04:53 -0400 |
commit | daa4cd4177690641a8fc29b836824856abf60711 (patch) | |
tree | 6c147979564bf87f9f784dd15eb9e65acfa59bf0 /networks/openssl.c | |
parent | 6bda8db538d8d9edbca3f607698f828c763966b2 (diff) | |
download | haxircd-daa4cd4177690641a8fc29b836824856abf60711.tar.gz haxircd-daa4cd4177690641a8fc29b836824856abf60711.zip |
haxstring: Add parenthesis to macro arguments
WRITES(fd, *s) where s is a pointer to a struct string will
not compile, as the macro expands to write(fd, *s.data, *s.len),
which it expects s to be a struct string and attempts to use
s.data and s.len as pointers. This is, of course, erroneous.
The correct expansion is write(fd, (*s).data, (*s).len); while
write(fd, s->data, s->len) is desirable, it is not achievable with
a simple macro expansion. In any case, the parenthesis shall be
added.
Diffstat (limited to 'networks/openssl.c')
0 files changed, 0 insertions, 0 deletions