diff options
author | ꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id> | 2019-09-12 10:45:28 +0800 |
---|---|---|
committer | ꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id> | 2019-09-12 10:45:28 +0800 |
commit | bf2f5bae48a3f7daee7f2096328dada68eacd3fd (patch) | |
tree | c4394509cf9a194b9241d67fd9b773b3383d18c2 /rtclient.c | |
parent | 73a484ced42c0370ea8569dc25be433904ca8647 (diff) |
Add ptr to a rtclient parameter
to be more correct, like in getline.
Diffstat (limited to 'rtclient.c')
-rw-r--r-- | rtclient.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -82,8 +82,8 @@ user_callback(void *contents, size_t size, size_t nmemb, void *writedata) lines[i++] = line; line = strtok(NULL, "\n"); } - rt_user **userp = (rt_user **)writedata; - rt_user *user = *userp; + rt_user **userptr = (rt_user **)writedata; + rt_user *user = *userptr; for (unsigned short i = 0; i < nproperties; i++) { char *token = strtok(lines[i], ":"); if (!strcmp(token, "id")) { @@ -195,13 +195,13 @@ static inline void request(const char *path, const char *suffix) curl_easy_perform(curl); } -bool rtclient_get_user(rt_user **user, const char *name) +bool rtclient_get_user(rt_user **userptr, const char *name) { - *user = malloc(sizeof(rt_user)); - curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void *)user); + *userptr = malloc(sizeof(rt_user)); + curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void *)userptr); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, user_callback); request("/REST/1.0/user/", name); - return (bool)(*user); + return (bool)(*userptr); } void rtclient_search(const char *query) |