From 5ba1aab614eee1d0308abd1a20d5c61bf3140e55 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Thu, 17 Nov 2022 00:04:24 +0200 Subject: [IPL/HW02] Fixed details function not working properly, when rest is empty --- .../Homework 02/commonlisp2html.y | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Year 2/Implementation of Programming Languages/Homework 02/commonlisp2html.y') 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, "
%s%s\n%s%s
", LBRACKET_SPAN, summary, rest, RBRACKET_SPAN); -- cgit v1.3.1-26-gb76a