diff options
author | ꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id> | 2019-10-02 12:40:44 +0800 |
---|---|---|
committer | ꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id> | 2019-10-02 12:40:44 +0800 |
commit | 219cb65aa0d71ef45f465853aac39e4b3d9d5611 (patch) | |
tree | 5d6f52bd64755c43725c4822552543e8fe06ea21 | |
parent | c64c0795f30df0d480999c1dae36f8ff0e2715a6 (diff) |
Request function take character argument to the format
-rw-r--r-- | request.h | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -36,6 +36,9 @@ inline void request(size_t (*writefunction)(void *, size_t, size_t, void *) } while ((uval /= 10)); length -= 2; break; + case 'c': + length++; + break; default: break; } @@ -43,6 +46,7 @@ inline void request(size_t (*writefunction)(void *, size_t, size_t, void *) va_end(ap); char url[length + 1]; + length = 0; strcpy(url, server_url); va_start(ap, fmt); @@ -53,10 +57,15 @@ inline void request(size_t (*writefunction)(void *, size_t, size_t, void *) case 's': sval = va_arg(ap, char *); strcat(url, sval); + length = strlen(url); break; case 'u': uval = va_arg(ap, unsigned int); sprintf(url, "%s%u", url, uval); + length = strlen(url); + break; + case 'c': + url[length++] = (char)va_arg(ap, int); break; default: break; |