diff --git a/cmoe.c b/cmoe.c index 397be1d..302dab0 100644 --- a/cmoe.c +++ b/cmoe.c @@ -89,7 +89,7 @@ static uint32_t get_content_len(int isbig, uint16_t* len_type, char* cntstr) { + 16 + isbig + sizeof(svg_tail) - 1; for(int i = 0; cntstr[i]; i++) { - len += len_type[cntstr[i] - '0'] + (sizeof(img_slot_front) + sizeof(img_slot_rear) - 1); + len += len_type[cntstr[i] - '0'] + (sizeof(img_slot_front) + sizeof(img_slot_rear) - 2); } return len; } @@ -149,7 +149,7 @@ static void return_count(char* name, char* theme) { printf(img_slot_front, w * i, w, h); int n = cntstr[i] - '0'; fwrite(theme_type[n], len_type[n], 1, stdout); - puts(img_slot_rear); + printf(img_slot_rear); } fflush(stdout); write(1, svg_tail, sizeof(svg_tail)-1); diff --git a/cmoe.h b/cmoe.h index 704d2e4..c3ebcd0 100644 --- a/cmoe.h +++ b/cmoe.h @@ -50,7 +50,7 @@ const char svg_big[] = " \n" " \n"; const char img_slot_front[] = " "; +const char img_slot_rear[] = "\">\n"; const char svg_tail[] = " \n" "";