Created block of code for single line branches at lines between 660-670. (#1287)

* Commit 2 ocr.c

Added {} to single-line conditional statements to create blocks instead of keeping them as single line branches.

* Update ocr.c
This commit is contained in:
VaishnaviC
2020-12-25 04:48:37 +05:30
committed by GitHub
parent 082100a0d4
commit 6216247ecb

View File

@@ -652,7 +652,6 @@ char *ocr_bitmap(void *arg, png_color *palette, png_byte *alpha, unsigned char *
char *font_tag = line_start;
while (1)
{
font_tag = strstr(font_tag + 1, "<font color=\"#");
if (font_tag == NULL || font_tag > line_end)
break;
@@ -660,8 +659,9 @@ char *ocr_bitmap(void *arg, png_color *palette, png_byte *alpha, unsigned char *
}
last_font_tag_end = strstr(last_font_tag, ">");
if (last_font_tag_end)
{
last_font_tag_end += 1; // move string to the "right" if ">" was found, otherwise leave empty string (solves #1084)
}
// Copy the content of the subtitle
memcpy(new_text_out_iter, line_start, line_end - line_start);
new_text_out_iter += line_end - line_start;
@@ -670,7 +670,6 @@ char *ocr_bitmap(void *arg, png_color *palette, png_byte *alpha, unsigned char *
if (line_end - line_start < length_closing_font ||
strncmp(line_start, closing_font, length_closing_font))
{
memcpy(new_text_out_iter, closing_font, length_closing_font);
new_text_out_iter += length_closing_font;
}