]> granicus.if.org Git - curl/commitdiff
fix compiler warning: conversion from "long" to "size_t" may lose sign
authorYang Tse <yangsita@gmail.com>
Mon, 28 Sep 2009 17:01:23 +0000 (17:01 +0000)
committerYang Tse <yangsita@gmail.com>
Mon, 28 Sep 2009 17:01:23 +0000 (17:01 +0000)
lib/cookie.c

index 6b19ab1669182856691ed10246ff797f0a9b8512..d121c0b2990cffccc1a39c5710570aaaa4576541 100644 (file)
@@ -442,9 +442,9 @@ Curl_cookie_add(struct SessionHandle *data,
       if(!queryp)
         endslash = strrchr(path, '/');
       else
-        endslash = memrchr(path, '/', queryp - path);
+        endslash = memrchr(path, '/', (size_t)(queryp - path));
       if(endslash) {
-        size_t pathlen = endslash-path+1; /* include the ending slash */
+        size_t pathlen = (size_t)(endslash-path+1); /* include ending slash */
         co->path=malloc(pathlen+1); /* one extra for the zero byte */
         if(co->path) {
           memcpy(co->path, path, pathlen);