commit e25960c5484392a6fd208ad3f63a483f5bbb695b
parent 578c94ba69c183ce9329c909cff415f6732885e6
Author: Saagar Jha <saagar@saagarjha.com>
Date: Sun, 7 May 2023 04:19:37 -0700
Fix pointer-to-int cast
Resolves "warning: performing pointer subtraction with a null pointer
has undefined behavior [-Wnull-pointer-subtraction]"
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/httpd.c b/httpd.c
@@ -366,7 +366,7 @@ void job_wait(xs_val **job)
static void *job_thread(void *arg)
/* job thread */
{
- int pid = (char *) arg - (char *) 0x0;
+ int pid = (int)(uintptr_t)arg;
srv_debug(1, xs_fmt("job thread %d started", pid));