diff --git a/lib/url.c b/lib/url.c
index d3ee364692598e5983d7558bd4cc8fa4aaa976fe..de31fd10713e86f10d85040a77186fcff538f857 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -1316,7 +1316,7 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option, ...)
      * Enable or disable TCP_NODELAY, which will disable/enable the Nagle
      * algorithm
      */
-    data->set.tcp_nodelay = va_arg(param, long);
+    data->set.tcp_nodelay = (bool)va_arg(param, long);
     break;
 
   default: