From 5366473097864d3b241d8c277ed87993fa35827f Mon Sep 17 00:00:00 2001 From: Yury Melnichek Date: Sat, 23 Mar 2013 17:27:26 +0100 Subject: [PATCH] [api] More code review fixes. --- api/src/c/api-client.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/api/src/c/api-client.c b/api/src/c/api-client.c index 701420a953..4c7c398efe 100644 --- a/api/src/c/api-client.c +++ b/api/src/c/api-client.c @@ -84,7 +84,9 @@ void MapsWithMe_TransformName(char * s) } } -// URL Encoding. +// URL Encode string s. +// Allocates memory that should be freed. +// 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) @@ -141,6 +143,7 @@ int MapsWithMe_UrlEncodeString(char const * s, int size, char ** res) return out - *res - 1; } +// 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) { int const bytesAvailable = bufSize - *bytesAppended; @@ -152,8 +155,6 @@ void MapsWithMe_AppendString(char * buf, int bufSize, int * bytesAppended, char int MapsWithMe_GenShortShowMapUrl(double lat, double lon, double zoom, char const * name, char * buf, int bufSize) { - // @TODO: Implement MapsWithMe_GenShortShowMapUrl(). - // URL format: // // +------------------ 1 byte: zoom level