aboutsummaryrefslogtreecommitdiff
path: root/regress
diff options
context:
space:
mode:
authorOmar Polo <op@omarpolo.com>2023-06-13 17:36:42 +0000
committerOmar Polo <op@omarpolo.com>2023-06-13 17:36:42 +0000
commit1959cda3d8cb21be770535e48529b7bdfa6e240d (patch)
tree9131e25b3a5cc8a2dbd71e1ea1dd54fb498a7d8a /regress
parentb90faa1605c46f14747742a30cf10721515e0cac (diff)
more avoiding of void pointer arithmetics
This time with a temporary variable to avoid not to trigger -Wpointer-sign, sigh.
Diffstat (limited to 'regress')
-rw-r--r--regress/fcgi-test.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/regress/fcgi-test.c b/regress/fcgi-test.c
index ea5cf65..fd7cec2 100644
--- a/regress/fcgi-test.c
+++ b/regress/fcgi-test.c
@@ -83,17 +83,18 @@ prepare_header(struct fcgi_header *h, int type, int id, size_t size,
static void
must_read(int sock, void *d, size_t len)
{
+ uint8_t *data = d;
ssize_t r;
while (len > 0) {
- switch (r = read(sock, d, len)) {
+ switch (r = read(sock, data, len)) {
case -1:
err(1, "read");
case 0:
errx(1, "EOF");
default:
len -= r;
- d += r;
+ data += r;
}
}
}
@@ -101,17 +102,18 @@ must_read(int sock, void *d, size_t len)
static void
must_write(int sock, const void *d, size_t len)
{
+ const uint8_t *data = d;
ssize_t w;
while (len > 0) {
- switch (w = write(sock, d, len)) {
+ switch (w = write(sock, data, len)) {
case -1:
err(1, "write");
case 0:
errx(1, "EOF");
default:
len -= w;
- d += w;
+ data += w;
}
}
}