Closed The-Debarghya closed 1 year ago
Thanks for opening this pull request for myanimelist-cli! Please wait shortly for someone to review.
I guess I forgot that I had to add libbsd as a dependency, I have added that to the workflow and the makefile.
@The-Debarghya Can you take a look at the following build error?
Run make all
gcc -c -g -Wall src/mya.c -o obj/mya.o
src/mya.c: In function ‘generate_endpoint’:
src/mya.c:253:3: error: a label can only be part of a statement and a declaration is not a statement
253 | const char* s = "completed";
| ^~~~~
make: *** [Makefile:41: obj/mya.o] Error 1
Error: Process completed with exit code 2.
Can you also leave a comment in #69 so I can assign that issue to you too :)
Can it be merged now?
@all-contributors please add @The-Debarghya for code
@jmakhack
I've put up a pull request to add @The-Debarghya! :tada:
Congrats on merging your first pull request to myanimelist-cli! Please give our project a star if you like what we are building here.
Associated Issue
Closes #70 #69
Implemented Solution
strcpy
functions withstrlcpy
where the buffer value was kept as static string length and added BUFFER as a macro forstrncpy(uri, json_object_get_string(next), BUFFER)
this particular case.strcat
functions withstrncat
where the max concat length was specified as static strings otherwise a macro MAX_ENDPOINT_LENGTH was used in this case:strncat(uri, endpoint, MAX_ENDPOINT_LENGTH);
and for this casestrncat(uri, username, MAX_USERNAME_LENGTH)
, a predefined macro MAX_USERNAME_LENGTH was used.