diff options
author | Xiao Pan <gky44px1999@gmail.com> | 2024-05-28 16:23:04 -0700 |
---|---|---|
committer | Xiao Pan <gky44px1999@gmail.com> | 2024-05-28 16:23:04 -0700 |
commit | d95494643624031193eb318e39cc38bf05dcb85e (patch) | |
tree | 895958a014e17a2f06ab55956c21edaf19437190 /dynotify.c | |
parent | 0daf019d6c7885b5b896a4e6f73e34a0e0df2eac (diff) |
refactor: dynotify: less code
Diffstat (limited to 'dynotify.c')
-rw-r--r-- | dynotify.c | 7 |
1 files changed, 2 insertions, 5 deletions
@@ -96,11 +96,8 @@ int main (void) // manpage assign 0 to struct, it seems because C11 when cast 0 to void* is same as NULL? see: // https://www.geeksforgeeks.org/null-pointer-in-c/ struct memory chunk = {0}; - char id_str[DYROOM_ID_LEN]; - // or itoa() - sprintf(id_str, "%d", room[i].id); - char url[29+DYROOM_ID_LEN]="https://www.douyu.com/betard/"; - strcat(url,id_str); + char url[29+DYROOM_ID_LEN]; + sprintf(url, "https://www.douyu.com/betard/%d", room[i].id); curl_easy_setopt(curl, CURLOPT_URL, url); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, cb); |