diff options
| Commit | 5ba1aab614eee1d0308abd1a20d5c61bf3140e55 (patch) | |
|---|---|---|
| Author | 2022-11-17 00:04:24 +0200 | |
| Committer | 2022-11-17 00:04:24 +0200 | |
| Files | 9c09e23bfba48a8728ac867bf51cd13d23ff0038 | |
| uni-projects-5ba1aab614eee1d0308abd1a20d5c61bf3140e55.tar uni-projects-5ba1aab614eee1d0308abd1a20d5c61bf3140e55.tar.gz uni-projects-5ba1aab614eee1d0308abd1a20d5c61bf3140e55.zip | ||
| Parent | 73c896b12d4ca4fdedda4201b9415c48d5524fd5 (diff) | |
[IPL/HW02] Fixed details function not working properly, when rest is empty
1 files changed, 1 insertions, 1 deletions
| -rw-r--r-- | Year 2/Implementation of Programming Languages/Homework 02/commonlisp2html.y | 2 |
diff --git a/Year 2/Implementation of Programming Languages/Homework 02/commonlisp2html.y b/Year 2/Implementation of Programming Languages/Homework 02/commonlisp2html.y index 184d796..2a7bf91 100644 --- a/Year 2/Implementation of Programming Languages/Homework 02/commonlisp2html.y +++ b/Year 2/Implementation of Programming Languages/Homework 02/commonlisp2html.y @@ -70,7 +70,7 @@ char* span(char *c, char *s) { return str; } char* details(char *summary, char *rest) { - if (rest == NULL) rest = concat2("", ""); // Зверски грозен фикс, но не е толкова голям проблем + if (*rest == '\0') rest = concat2("", ""); // Зверски грозен фикс, но не е толкова голям проблем char* str = (char*)malloc(strlen(LBRACKET_SPAN) + strlen(summary) + strlen(rest) + strlen(RBRACKET_SPAN) + 1 + 39); sprintf(str, "<details><summary>%s%s</summary>\n%s%s</details>", LBRACKET_SPAN, summary, rest, RBRACKET_SPAN); |
