diff options
author | Sergey Yershov <yershov@corp.mail.ru> | 2015-04-23 12:21:17 +0300 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 02:46:19 +0300 |
commit | 496f087b44e953e58c351f89ed3b212a101fc6e7 (patch) | |
tree | b94a3bc647515da281ae28db3338d61ca118cae6 /api | |
parent | 6de33495b2043d45cd29999b2579dca208e451c8 (diff) |
Fix warning for Api
Diffstat (limited to 'api')
-rw-r--r-- | api/src/c/api-client.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/api/src/c/api-client.c b/api/src/c/api-client.c index 6d983d842a..2792696e22 100644 --- a/api/src/c/api-client.c +++ b/api/src/c/api-client.c @@ -90,7 +90,7 @@ void MapsWithMe_TransformName(char * s) // Returns the lenghts of the resulting string in bytes including terminating 0. // URL restricted / unsafe / unwise characters are %-encoded. // See rfc3986, rfc1738, rfc2396. -int MapsWithMe_UrlEncodeString(char const * s, int size, char ** res) +size_t MapsWithMe_UrlEncodeString(char const * s, size_t size, char ** res) { *res = malloc(size * 3 + 1); char * out = *res; @@ -146,9 +146,9 @@ int MapsWithMe_UrlEncodeString(char const * s, int size, char ** res) } // Append s to buf (is there is space). Increment *bytesAppended by size. -void MapsWithMe_AppendString(char * buf, int bufSize, int * bytesAppended, char const * s, int size) +void MapsWithMe_AppendString(char * buf, int bufSize, int * bytesAppended, char const * s, size_t size) { - int const bytesAvailable = bufSize - *bytesAppended; + size_t const bytesAvailable = bufSize - *bytesAppended; if (bytesAvailable > 0) memcpy(buf + *bytesAppended, s, size < bytesAvailable ? size : bytesAvailable); @@ -189,7 +189,7 @@ int MapsWithMe_GenShortShowMapUrl(double lat, double lon, double zoom, char cons MapsWithMe_TransformName(newName); char * encName; - int const encNameSize = MapsWithMe_UrlEncodeString(newName, strlen(newName), &encName); + size_t const encNameSize = MapsWithMe_UrlEncodeString(newName, strlen(newName), &encName); MapsWithMe_AppendString(buf, bufSize, &fullUrlSize, encName, encNameSize); |