Allow compilation with -Werror=format-security
This commit fixes some calls to functions that are taking a format
string and an optional set of parameters as arguments. At some places
no format string was specified if only a simple C string was to be
sprintf()ed. However for security reasons this is bad and was replaced
by code like
sprintf( dest, "%s", str );
(cherry picked from commit af284e980f)
This commit is contained in:
committed by
Tobias Doerffel
parent
1bc94beae6
commit
03ecb86494
@@ -108,10 +108,10 @@ attr_express_begin (int attr, const char* param) {
|
||||
switch(attr)
|
||||
{
|
||||
case ATTR_BOLD:
|
||||
outstring+=QString().sprintf(op->bold_begin);
|
||||
outstring+=QString().sprintf("%s", op->bold_begin);
|
||||
break;
|
||||
case ATTR_ITALIC:
|
||||
outstring+=QString().sprintf(op->italic_begin);
|
||||
outstring+=QString().sprintf("%s", op->italic_begin);
|
||||
break;
|
||||
|
||||
/* Various underlines, they all resolve to HTML's <u> */
|
||||
@@ -123,11 +123,11 @@ attr_express_begin (int attr, const char* param) {
|
||||
case ATTR_2DOT_DASH_UL:
|
||||
case ATTR_WORD_UL:
|
||||
case ATTR_UNDERLINE:
|
||||
outstring+=QString().sprintf(op->underline_begin);
|
||||
outstring+=QString().sprintf("%s", op->underline_begin);
|
||||
break;
|
||||
|
||||
case ATTR_DOUBLE_UL:
|
||||
outstring+=QString().sprintf(op->dbl_underline_begin);
|
||||
outstring+=QString().sprintf("%s", op->dbl_underline_begin);
|
||||
break;
|
||||
|
||||
case ATTR_FONTSIZE:
|
||||
@@ -148,18 +148,18 @@ attr_express_begin (int attr, const char* param) {
|
||||
break;
|
||||
|
||||
case ATTR_SUPER:
|
||||
outstring+=QString().sprintf(op->superscript_begin);
|
||||
outstring+=QString().sprintf("%s", op->superscript_begin);
|
||||
break;
|
||||
case ATTR_SUB:
|
||||
outstring+=QString().sprintf(op->subscript_begin);
|
||||
outstring+=QString().sprintf("%s", op->subscript_begin);
|
||||
break;
|
||||
|
||||
case ATTR_STRIKE:
|
||||
outstring+=QString().sprintf(op->strikethru_begin);
|
||||
outstring+=QString().sprintf("%s", op->strikethru_begin);
|
||||
break;
|
||||
|
||||
case ATTR_DBL_STRIKE:
|
||||
outstring+=QString().sprintf(op->dbl_strikethru_begin);
|
||||
outstring+=QString().sprintf("%s", op->dbl_strikethru_begin);
|
||||
break;
|
||||
|
||||
case ATTR_EXPAND:
|
||||
@@ -167,16 +167,16 @@ attr_express_begin (int attr, const char* param) {
|
||||
break;
|
||||
|
||||
case ATTR_OUTLINE:
|
||||
outstring+=QString().sprintf(op->outline_begin);
|
||||
outstring+=QString().sprintf("%s", op->outline_begin);
|
||||
break;
|
||||
case ATTR_SHADOW:
|
||||
outstring+=QString().sprintf(op->shadow_begin);
|
||||
outstring+=QString().sprintf("%s", op->shadow_begin);
|
||||
break;
|
||||
case ATTR_EMBOSS:
|
||||
outstring+=QString().sprintf(op->emboss_begin);
|
||||
outstring+=QString().sprintf("%s", op->emboss_begin);
|
||||
break;
|
||||
case ATTR_ENGRAVE:
|
||||
outstring+=QString().sprintf(op->engrave_begin);
|
||||
outstring+=QString().sprintf("%s", op->engrave_begin);
|
||||
break;
|
||||
|
||||
case ATTR_CAPS:
|
||||
@@ -189,7 +189,7 @@ attr_express_begin (int attr, const char* param) {
|
||||
simulate_smallcaps = TRUE;
|
||||
else {
|
||||
if (op->small_caps_begin)
|
||||
outstring+=QString().sprintf(op->small_caps_begin);
|
||||
outstring+=QString().sprintf("%s", op->small_caps_begin);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -209,10 +209,10 @@ attr_express_end (int attr, char *param)
|
||||
switch(attr)
|
||||
{
|
||||
case ATTR_BOLD:
|
||||
outstring+=QString().sprintf(op->bold_end);
|
||||
outstring+=QString().sprintf("%s", op->bold_end);
|
||||
break;
|
||||
case ATTR_ITALIC:
|
||||
outstring+=QString().sprintf(op->italic_end);
|
||||
outstring+=QString().sprintf("%s", op->italic_end);
|
||||
break;
|
||||
|
||||
/* Various underlines, they all resolve to HTML's </u> */
|
||||
@@ -224,11 +224,11 @@ attr_express_end (int attr, char *param)
|
||||
case ATTR_2DOT_DASH_UL:
|
||||
case ATTR_WORD_UL:
|
||||
case ATTR_UNDERLINE:
|
||||
outstring+=QString().sprintf(op->underline_end);
|
||||
outstring+=QString().sprintf("%s", op->underline_end);
|
||||
break;
|
||||
|
||||
case ATTR_DOUBLE_UL:
|
||||
outstring+=QString().sprintf(op->dbl_underline_end);
|
||||
outstring+=QString().sprintf("%s", op->dbl_underline_end);
|
||||
break;
|
||||
|
||||
case ATTR_FONTSIZE:
|
||||
@@ -236,47 +236,47 @@ attr_express_end (int attr, char *param)
|
||||
break;
|
||||
|
||||
case ATTR_FONTFACE:
|
||||
outstring+=QString().sprintf(op->font_end);
|
||||
outstring+=QString().sprintf("%s", op->font_end);
|
||||
break;
|
||||
|
||||
case ATTR_FOREGROUND:
|
||||
outstring+=QString().sprintf(op->foreground_end);
|
||||
outstring+=QString().sprintf("%s", op->foreground_end);
|
||||
break;
|
||||
case ATTR_BACKGROUND:
|
||||
if (!simple_mode)
|
||||
outstring+=QString().sprintf(op->background_end);
|
||||
outstring+=QString().sprintf("%s", op->background_end);
|
||||
break;
|
||||
|
||||
case ATTR_SUPER:
|
||||
outstring+=QString().sprintf(op->superscript_end);
|
||||
outstring+=QString().sprintf("%s", op->superscript_end);
|
||||
break;
|
||||
case ATTR_SUB:
|
||||
outstring+=QString().sprintf(op->subscript_end);
|
||||
outstring+=QString().sprintf("%s", op->subscript_end);
|
||||
break;
|
||||
|
||||
case ATTR_STRIKE:
|
||||
outstring+=QString().sprintf(op->strikethru_end);
|
||||
outstring+=QString().sprintf("%s", op->strikethru_end);
|
||||
break;
|
||||
|
||||
case ATTR_DBL_STRIKE:
|
||||
outstring+=QString().sprintf(op->dbl_strikethru_end);
|
||||
outstring+=QString().sprintf("%s", op->dbl_strikethru_end);
|
||||
break;
|
||||
|
||||
case ATTR_OUTLINE:
|
||||
outstring+=QString().sprintf(op->outline_end);
|
||||
outstring+=QString().sprintf("%s", op->outline_end);
|
||||
break;
|
||||
case ATTR_SHADOW:
|
||||
outstring+=QString().sprintf(op->shadow_end);
|
||||
outstring+=QString().sprintf("%s", op->shadow_end);
|
||||
break;
|
||||
case ATTR_EMBOSS:
|
||||
outstring+=QString().sprintf(op->emboss_end);
|
||||
outstring+=QString().sprintf("%s", op->emboss_end);
|
||||
break;
|
||||
case ATTR_ENGRAVE:
|
||||
outstring+=QString().sprintf(op->engrave_end);
|
||||
outstring+=QString().sprintf("%s", op->engrave_end);
|
||||
break;
|
||||
|
||||
case ATTR_EXPAND:
|
||||
outstring+=QString().sprintf(op->expand_end);
|
||||
outstring+=QString().sprintf("%s", op->expand_end);
|
||||
break;
|
||||
|
||||
case ATTR_CAPS:
|
||||
@@ -289,7 +289,7 @@ attr_express_end (int attr, char *param)
|
||||
simulate_smallcaps = FALSE;
|
||||
else {
|
||||
if (op->small_caps_end)
|
||||
outstring+=QString().sprintf(op->small_caps_end);
|
||||
outstring+=QString().sprintf("%s", op->small_caps_end);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -650,8 +650,8 @@ starting_body ()
|
||||
{
|
||||
if (!have_printed_body) {
|
||||
if (!inline_mode) {
|
||||
outstring+=QString().sprintf(op->header_end);
|
||||
outstring+=QString().sprintf(op->body_begin);
|
||||
outstring+=QString().sprintf("%s", op->header_end);
|
||||
outstring+=QString().sprintf("%s", op->body_begin);
|
||||
}
|
||||
within_header = FALSE;
|
||||
have_printed_body = TRUE;
|
||||
@@ -926,7 +926,7 @@ process_info_group (Word *w)
|
||||
|
||||
if (!inline_mode) {
|
||||
if (!strcmp("\\title", s)) {
|
||||
outstring+=QString().sprintf(op->document_title_begin);
|
||||
outstring+=QString().sprintf("%s", op->document_title_begin);
|
||||
w2=child->next;
|
||||
while (w2) {
|
||||
char *s2 = word_string(w2);
|
||||
@@ -951,18 +951,18 @@ process_info_group (Word *w)
|
||||
s3 = op_translate_char (op, charset_type, charset_codepage, ch, numchar_table);
|
||||
if (!s3 || !*s3)
|
||||
{
|
||||
outstring+=QString().sprintf(op->comment_begin);
|
||||
outstring+=QString().sprintf("%s", op->comment_begin);
|
||||
outstring+=QString().sprintf("char 0x%02x",ch);
|
||||
outstring+=QString().sprintf(op->comment_end);
|
||||
outstring+=QString().sprintf("%s", op->comment_end);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if (op->word_begin)
|
||||
outstring+=QString().sprintf(op->word_begin);
|
||||
outstring+=QString().sprintf("%s", op->word_begin);
|
||||
outstring+=QString().sprintf("%s", s3);
|
||||
if (op->word_end)
|
||||
outstring+=QString().sprintf(op->word_end);
|
||||
outstring+=QString().sprintf("%s", op->word_end);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -970,10 +970,10 @@ process_info_group (Word *w)
|
||||
#endif
|
||||
w2 = w2->next;
|
||||
}
|
||||
outstring+=QString().sprintf(op->document_title_end);
|
||||
outstring+=QString().sprintf("%s", op->document_title_end);
|
||||
}
|
||||
else if (!strcmp("\\keywords", s)) {
|
||||
outstring+=QString().sprintf(op->document_keywords_begin);
|
||||
outstring+=QString().sprintf("%s", op->document_keywords_begin);
|
||||
w2=child->next;
|
||||
while (w2) {
|
||||
char *s2 = word_string(w2);
|
||||
@@ -981,10 +981,10 @@ process_info_group (Word *w)
|
||||
outstring+=QString().sprintf("%s,", s2);
|
||||
w2 = w2->next;
|
||||
}
|
||||
outstring+=QString().sprintf(op->document_keywords_end);
|
||||
outstring+=QString().sprintf("%s", op->document_keywords_end);
|
||||
}
|
||||
else if (!strcmp("\\author", s)) {
|
||||
outstring+=QString().sprintf(op->document_author_begin);
|
||||
outstring+=QString().sprintf("%s", op->document_author_begin);
|
||||
w2=child->next;
|
||||
while (w2) {
|
||||
char *s2 = word_string(w2);
|
||||
@@ -992,7 +992,7 @@ process_info_group (Word *w)
|
||||
outstring+=QString().sprintf("%s", s2);
|
||||
w2 = w2->next;
|
||||
}
|
||||
outstring+=QString().sprintf(op->document_author_end);
|
||||
outstring+=QString().sprintf("%s", op->document_author_end);
|
||||
}
|
||||
else if (!strcmp("\\comment", s)) {
|
||||
outstring+=QString().sprintf("%s",op->comment_begin);
|
||||
@@ -1312,9 +1312,9 @@ cmd_field (Word *w, int align, char has_param, int num) {
|
||||
w4=w4->next;
|
||||
if (w4) {
|
||||
s4=word_string(w4);
|
||||
outstring+=QString().sprintf(op->hyperlink_begin);
|
||||
outstring+=QString().sprintf("%s", op->hyperlink_begin);
|
||||
outstring+=QString().sprintf("%s", s4);
|
||||
outstring+=QString().sprintf(op->hyperlink_end);
|
||||
outstring+=QString().sprintf("%s", op->hyperlink_end);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -1423,7 +1423,7 @@ cmd_tab (Word *w, int align, char has_param, int param)
|
||||
int need= 8-(total_chars_this_line%8);
|
||||
total_chars_this_line += need;
|
||||
while(need>0) {
|
||||
outstring+=QString().sprintf(op->forced_space);
|
||||
outstring+=QString().sprintf("%s", op->forced_space);
|
||||
need--;
|
||||
}
|
||||
outstring+=QString().sprintf("\n");
|
||||
@@ -1643,7 +1643,7 @@ cmd_scaps (Word *w, int align, char has_param, int param) {
|
||||
static int
|
||||
cmd_bullet (Word *w, int align, char has_param, int param) {
|
||||
if (op->chars.bullet) {
|
||||
outstring+=QString().sprintf(op->chars.bullet);
|
||||
outstring+=QString().sprintf("%s", op->chars.bullet);
|
||||
++total_chars_this_line; /* \tab */
|
||||
}
|
||||
return FALSE;
|
||||
@@ -1658,7 +1658,7 @@ cmd_bullet (Word *w, int align, char has_param, int param) {
|
||||
static int
|
||||
cmd_ldblquote (Word *w, int align, char has_param, int param) {
|
||||
if (op->chars.left_dbl_quote) {
|
||||
outstring+=QString().sprintf(op->chars.left_dbl_quote);
|
||||
outstring+=QString().sprintf("%s", op->chars.left_dbl_quote);
|
||||
++total_chars_this_line; /* \tab */
|
||||
}
|
||||
return FALSE;
|
||||
@@ -1675,7 +1675,7 @@ cmd_ldblquote (Word *w, int align, char has_param, int param) {
|
||||
static int
|
||||
cmd_rdblquote (Word *w, int align, char has_param, int param) {
|
||||
if (op->chars.right_dbl_quote) {
|
||||
outstring+=QString().sprintf(op->chars.right_dbl_quote);
|
||||
outstring+=QString().sprintf("%s", op->chars.right_dbl_quote);
|
||||
++total_chars_this_line; /* \tab */
|
||||
}
|
||||
return FALSE;
|
||||
@@ -1691,7 +1691,7 @@ cmd_rdblquote (Word *w, int align, char has_param, int param) {
|
||||
static int
|
||||
cmd_lquote (Word *w, int align, char has_param, int param) {
|
||||
if (op->chars.left_quote) {
|
||||
outstring+=QString().sprintf(op->chars.left_quote);
|
||||
outstring+=QString().sprintf("%s", op->chars.left_quote);
|
||||
++total_chars_this_line; /* \tab */
|
||||
}
|
||||
return FALSE;
|
||||
@@ -1708,7 +1708,7 @@ cmd_lquote (Word *w, int align, char has_param, int param) {
|
||||
static int
|
||||
cmd_nonbreaking_space (Word *w, int align, char has_param, int param) {
|
||||
if (op->chars.nonbreaking_space) {
|
||||
outstring+=QString().sprintf(op->chars.nonbreaking_space);
|
||||
outstring+=QString().sprintf("%s", op->chars.nonbreaking_space);
|
||||
++total_chars_this_line; /* \tab */
|
||||
}
|
||||
return FALSE;
|
||||
@@ -1725,7 +1725,7 @@ cmd_nonbreaking_space (Word *w, int align, char has_param, int param) {
|
||||
static int
|
||||
cmd_nonbreaking_hyphen (Word *w, int align, char has_param, int param) {
|
||||
if (op->chars.nonbreaking_hyphen) {
|
||||
outstring+=QString().sprintf(op->chars.nonbreaking_hyphen);
|
||||
outstring+=QString().sprintf("%s", op->chars.nonbreaking_hyphen);
|
||||
++total_chars_this_line; /* \tab */
|
||||
}
|
||||
return FALSE;
|
||||
@@ -1742,7 +1742,7 @@ cmd_nonbreaking_hyphen (Word *w, int align, char has_param, int param) {
|
||||
static int
|
||||
cmd_optional_hyphen (Word *w, int align, char has_param, int param) {
|
||||
if (op->chars.optional_hyphen) {
|
||||
outstring+=QString().sprintf(op->chars.optional_hyphen);
|
||||
outstring+=QString().sprintf("%s", op->chars.optional_hyphen);
|
||||
++total_chars_this_line; /* \tab */
|
||||
}
|
||||
return FALSE;
|
||||
@@ -1758,7 +1758,7 @@ cmd_optional_hyphen (Word *w, int align, char has_param, int param) {
|
||||
static int
|
||||
cmd_emdash (Word *w, int align, char has_param, int param) {
|
||||
if (op->chars.emdash) {
|
||||
outstring+=QString().sprintf(op->chars.emdash);
|
||||
outstring+=QString().sprintf("%s", op->chars.emdash);
|
||||
++total_chars_this_line; /* \tab */
|
||||
}
|
||||
return FALSE;
|
||||
@@ -1775,7 +1775,7 @@ cmd_emdash (Word *w, int align, char has_param, int param) {
|
||||
static int
|
||||
cmd_endash (Word *w, int align, char has_param, int param) {
|
||||
if (op->chars.endash) {
|
||||
outstring+=QString().sprintf(op->chars.endash);
|
||||
outstring+=QString().sprintf("%s", op->chars.endash);
|
||||
++total_chars_this_line; /* \tab */
|
||||
}
|
||||
return FALSE;
|
||||
@@ -1792,7 +1792,7 @@ cmd_endash (Word *w, int align, char has_param, int param) {
|
||||
static int
|
||||
cmd_rquote (Word *w, int align, char has_param, int param) {
|
||||
if (op->chars.right_quote) {
|
||||
outstring+=QString().sprintf(op->chars.right_quote);
|
||||
outstring+=QString().sprintf("%s", op->chars.right_quote);
|
||||
++total_chars_this_line; /* \tab */
|
||||
}
|
||||
return FALSE;
|
||||
@@ -1808,7 +1808,7 @@ cmd_rquote (Word *w, int align, char has_param, int param) {
|
||||
static int
|
||||
cmd_par (Word *w, int align, char has_param, int param) {
|
||||
if (op->line_break) {
|
||||
outstring+=QString().sprintf(op->line_break);
|
||||
outstring+=QString().sprintf("%s", op->line_break);
|
||||
total_chars_this_line = 0; /* \tab */
|
||||
}
|
||||
return FALSE;
|
||||
@@ -1825,7 +1825,7 @@ cmd_par (Word *w, int align, char has_param, int param) {
|
||||
static int
|
||||
cmd_line (Word *w, int align, char has_param, int param) {
|
||||
if (op->line_break) {
|
||||
outstring+=QString().sprintf(op->line_break);
|
||||
outstring+=QString().sprintf("%s", op->line_break);
|
||||
total_chars_this_line = 0; /* \tab */
|
||||
}
|
||||
return FALSE;
|
||||
@@ -1841,7 +1841,7 @@ cmd_line (Word *w, int align, char has_param, int param) {
|
||||
|
||||
static int cmd_page (Word *w, int align, char has_param, int param) {
|
||||
if (op->page_break) {
|
||||
outstring+=QString().sprintf(op->page_break);
|
||||
outstring+=QString().sprintf("%s", op->page_break);
|
||||
total_chars_this_line = 0; /* \tab */
|
||||
}
|
||||
return FALSE;
|
||||
@@ -2337,7 +2337,7 @@ static int cmd_s (Word *w, int align, char has_param, int param) {
|
||||
static int cmd_sect (Word *w, int align, char has_param, int param) {
|
||||
/* XX kludge */
|
||||
if (op->paragraph_begin) {
|
||||
outstring+=QString().sprintf(op->paragraph_begin);
|
||||
outstring+=QString().sprintf("%s", op->paragraph_begin);
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
@@ -2351,9 +2351,9 @@ static int cmd_sect (Word *w, int align, char has_param, int param) {
|
||||
|
||||
static int cmd_shp (Word *w, int align, char has_param, int param) {
|
||||
if (op->comment_begin) {
|
||||
outstring+=QString().sprintf(op->comment_begin);
|
||||
outstring+=QString().sprintf("%s", op->comment_begin);
|
||||
outstring+=QString().sprintf("Drawn Shape (ignored--not implemented yet)");
|
||||
outstring+=QString().sprintf(op->comment_end); /* daved 0.20.2 */
|
||||
outstring+=QString().sprintf("%s", op->comment_end); /* daved 0.20.2 */
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
@@ -2404,17 +2404,17 @@ static int cmd_ansicpg (Word *w, int align, char has_param, int param) {
|
||||
charset_codepage = &codepages[i];
|
||||
if (charset_codepage->cp == param) {
|
||||
if (op->comment_begin) {
|
||||
outstring+=QString().sprintf(op->comment_begin);
|
||||
outstring+=QString().sprintf("%s", op->comment_begin);
|
||||
outstring+=QString().sprintf("document uses ANSI codepage %d character set", param);
|
||||
outstring+=QString().sprintf(op->comment_end);
|
||||
outstring+=QString().sprintf("%s", op->comment_end);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ((charset_codepage == NULL || charset_codepage->cp == 0) && op->comment_begin) {
|
||||
outstring+=QString().sprintf(op->comment_begin);
|
||||
outstring+=QString().sprintf("%s", op->comment_begin);
|
||||
outstring+=QString().sprintf("document uses default ANSI codepage character set");
|
||||
outstring+=QString().sprintf(op->comment_end);
|
||||
outstring+=QString().sprintf("%s", op->comment_end);
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
@@ -3106,7 +3106,7 @@ enum { SMALL=0, BIG=1 };
|
||||
if (simulate_smallcaps) {
|
||||
if (*s >= 'a' && *s <= 'z') {
|
||||
state=SMALL;
|
||||
outstring+=QString().sprintf(op->smaller_begin);
|
||||
outstring+=QString().sprintf("%s", op->smaller_begin);
|
||||
}
|
||||
else
|
||||
state=BIG;
|
||||
@@ -3136,13 +3136,13 @@ enum { SMALL=0, BIG=1 };
|
||||
ch = *s;
|
||||
if (ch >= 'a' && ch <= 'z') {
|
||||
if (state==BIG)
|
||||
outstring+=QString().sprintf(op->smaller_begin);
|
||||
outstring+=QString().sprintf("%s", op->smaller_begin);
|
||||
state=SMALL;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (state==SMALL)
|
||||
outstring+=QString().sprintf(op->smaller_end);
|
||||
outstring+=QString().sprintf("%s", op->smaller_end);
|
||||
state=BIG;
|
||||
}
|
||||
}
|
||||
@@ -3168,7 +3168,7 @@ begin_table()
|
||||
have_printed_cell_end = FALSE;
|
||||
attrstack_push();
|
||||
starting_body();
|
||||
outstring+=QString().sprintf(op->table_begin);
|
||||
outstring+=QString().sprintf("%s", op->table_begin);
|
||||
}
|
||||
|
||||
|
||||
@@ -3186,12 +3186,12 @@ end_table ()
|
||||
if (within_table) {
|
||||
if (!have_printed_cell_end) {
|
||||
attr_pop_dump();
|
||||
outstring+=QString().sprintf(op->table_cell_end);
|
||||
outstring+=QString().sprintf("%s", op->table_cell_end);
|
||||
}
|
||||
if (!have_printed_row_end) {
|
||||
outstring+=QString().sprintf(op->table_row_end);
|
||||
outstring+=QString().sprintf("%s", op->table_row_end);
|
||||
}
|
||||
outstring+=QString().sprintf(op->table_end);
|
||||
outstring+=QString().sprintf("%s", op->table_end);
|
||||
within_table=FALSE;
|
||||
have_printed_row_begin = FALSE;
|
||||
have_printed_cell_begin = FALSE;
|
||||
@@ -3213,13 +3213,13 @@ void
|
||||
starting_text() {
|
||||
if (within_table) {
|
||||
if (!have_printed_row_begin) {
|
||||
outstring+=QString().sprintf(op->table_row_begin);
|
||||
outstring+=QString().sprintf("%s", op->table_row_begin);
|
||||
have_printed_row_begin=TRUE;
|
||||
have_printed_row_end=FALSE;
|
||||
have_printed_cell_begin=FALSE;
|
||||
}
|
||||
if (!have_printed_cell_begin) {
|
||||
outstring+=QString().sprintf(op->table_cell_begin);
|
||||
outstring+=QString().sprintf("%s", op->table_cell_begin);
|
||||
attrstack_express_all();
|
||||
have_printed_cell_begin=TRUE;
|
||||
have_printed_cell_end=FALSE;
|
||||
@@ -3246,15 +3246,15 @@ starting_paragraph_align (int align)
|
||||
switch (align)
|
||||
{
|
||||
case ALIGN_CENTER:
|
||||
outstring+=QString().sprintf(op->center_begin);
|
||||
outstring+=QString().sprintf("%s", op->center_begin);
|
||||
break;
|
||||
case ALIGN_LEFT:
|
||||
break;
|
||||
case ALIGN_RIGHT:
|
||||
outstring+=QString().sprintf(op->align_right_begin);
|
||||
outstring+=QString().sprintf("%s", op->align_right_begin);
|
||||
break;
|
||||
case ALIGN_JUSTIFY:
|
||||
outstring+=QString().sprintf(op->align_right_begin); /* This is WRONG! */
|
||||
outstring+=QString().sprintf("%s", op->align_right_begin); /* This is WRONG! */
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -3273,16 +3273,16 @@ ending_paragraph_align (int align)
|
||||
{
|
||||
switch (align) {
|
||||
case ALIGN_CENTER:
|
||||
outstring+=QString().sprintf(op->center_end);
|
||||
outstring+=QString().sprintf("%s", op->center_end);
|
||||
break;
|
||||
case ALIGN_LEFT:
|
||||
/* outstring+=QString().sprintf(op->align_left_end); */
|
||||
/* outstring+=QString().sprintf("%s", op->align_left_end); */
|
||||
break;
|
||||
case ALIGN_RIGHT:
|
||||
outstring+=QString().sprintf(op->align_right_end);
|
||||
outstring+=QString().sprintf("%s", op->align_right_end);
|
||||
break;
|
||||
case ALIGN_JUSTIFY:
|
||||
outstring+=QString().sprintf(op->justify_end);
|
||||
outstring+=QString().sprintf("%s", op->justify_end);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -3391,12 +3391,12 @@ word_print_core (Word *w)
|
||||
total_chars_this_line += strlen(s);
|
||||
|
||||
if (op->word_begin)
|
||||
outstring+=QString().sprintf(op->word_begin);
|
||||
outstring+=QString().sprintf("%s", op->word_begin);
|
||||
|
||||
print_with_special_exprs (s);
|
||||
|
||||
if (op->word_end)
|
||||
outstring+=QString().sprintf(op->word_end);
|
||||
outstring+=QString().sprintf("%s", op->word_end);
|
||||
}
|
||||
|
||||
|
||||
@@ -3456,17 +3456,17 @@ word_print_core (Word *w)
|
||||
is_cell_group=TRUE;
|
||||
if (!have_printed_cell_begin) {
|
||||
/* Need this with empty cells */
|
||||
outstring+=QString().sprintf(op->table_cell_begin);
|
||||
outstring+=QString().sprintf("%s", op->table_cell_begin);
|
||||
attrstack_express_all();
|
||||
}
|
||||
attr_pop_dump();
|
||||
outstring+=QString().sprintf(op->table_cell_end);
|
||||
outstring+=QString().sprintf("%s", op->table_cell_end);
|
||||
have_printed_cell_begin = FALSE;
|
||||
have_printed_cell_end=TRUE;
|
||||
}
|
||||
else if (!strcmp (s, "row")) {
|
||||
if (within_table) {
|
||||
outstring+=QString().sprintf(op->table_row_end);
|
||||
outstring+=QString().sprintf("%s", op->table_row_end);
|
||||
have_printed_row_begin = FALSE;
|
||||
have_printed_row_end=TRUE;
|
||||
} else {
|
||||
@@ -3496,10 +3496,10 @@ word_print_core (Word *w)
|
||||
outstring+=QString().sprintf("%s",op->comment_end);
|
||||
} else {
|
||||
if (op->word_begin)
|
||||
outstring+=QString().sprintf(op->word_begin);
|
||||
outstring+=QString().sprintf("%s", op->word_begin);
|
||||
outstring+=QString().sprintf("%s", s2);
|
||||
if (op->word_end)
|
||||
outstring+=QString().sprintf(op->word_end);
|
||||
outstring+=QString().sprintf("%s", op->word_end);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -3529,9 +3529,9 @@ word_print_core (Word *w)
|
||||
|
||||
if (!hip) {
|
||||
if (debug_mode) {
|
||||
outstring+=QString().sprintf(op->comment_begin);
|
||||
outstring+=QString().sprintf("%s", op->comment_begin);
|
||||
outstring+=QString().sprintf("Unfamiliar RTF command: %s (HashIndex not found)", s);
|
||||
outstring+=QString().sprintf(op->comment_end); /* daved 0.20.2 */
|
||||
outstring+=QString().sprintf("%s", op->comment_end); /* daved 0.20.2 */
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -3610,9 +3610,9 @@ word_print_core (Word *w)
|
||||
if (within_picture) {
|
||||
if(pictfile) {
|
||||
fclose(pictfile);
|
||||
outstring+=QString().sprintf(op->imagelink_begin);
|
||||
outstring+=QString().sprintf("%s", op->imagelink_begin);
|
||||
outstring+=QString().sprintf("%s", picture_path);
|
||||
outstring+=QString().sprintf(op->imagelink_end);
|
||||
outstring+=QString().sprintf("%s", op->imagelink_end);
|
||||
}
|
||||
within_picture=FALSE;
|
||||
}
|
||||
@@ -3665,8 +3665,8 @@ word_print (Word *w, QString & _s)
|
||||
|
||||
outstring = "";
|
||||
if (!inline_mode) {
|
||||
outstring+=QString().sprintf(op->document_begin);
|
||||
outstring+=QString().sprintf(op->header_begin);
|
||||
outstring+=QString().sprintf("%s", op->document_begin);
|
||||
outstring+=QString().sprintf("%s", op->header_begin);
|
||||
}
|
||||
|
||||
within_header=TRUE;
|
||||
@@ -3677,8 +3677,8 @@ word_print (Word *w, QString & _s)
|
||||
end_table();
|
||||
|
||||
if (!inline_mode) {
|
||||
outstring+=QString().sprintf(op->body_end);
|
||||
outstring+=QString().sprintf(op->document_end);
|
||||
outstring+=QString().sprintf("%s", op->body_end);
|
||||
outstring+=QString().sprintf("%s", op->document_end);
|
||||
}
|
||||
_s = outstring;
|
||||
}
|
||||
|
||||
@@ -238,49 +238,49 @@ op_begin_std_fontsize (OutputPersonality *op, int size)
|
||||
switch (size) {
|
||||
case 8:
|
||||
if (op->fontsize8_begin) {
|
||||
outstring+=QString().sprintf(op->fontsize8_begin);
|
||||
outstring+=QString().sprintf("%s", op->fontsize8_begin);
|
||||
found_std_expr = TRUE;
|
||||
}
|
||||
break;
|
||||
case 10:
|
||||
if (op->fontsize10_begin) {
|
||||
outstring+=QString().sprintf(op->fontsize10_begin);
|
||||
outstring+=QString().sprintf("%s", op->fontsize10_begin);
|
||||
found_std_expr = TRUE;
|
||||
}
|
||||
break;
|
||||
case 12:
|
||||
if (op->fontsize12_begin) {
|
||||
outstring+=QString().sprintf(op->fontsize12_begin);
|
||||
outstring+=QString().sprintf("%s", op->fontsize12_begin);
|
||||
found_std_expr = TRUE;
|
||||
}
|
||||
break;
|
||||
case 14:
|
||||
if (op->fontsize14_begin) {
|
||||
outstring+=QString().sprintf(op->fontsize14_begin);
|
||||
outstring+=QString().sprintf("%s", op->fontsize14_begin);
|
||||
found_std_expr = TRUE;
|
||||
}
|
||||
break;
|
||||
case 18:
|
||||
if (op->fontsize18_begin) {
|
||||
outstring+=QString().sprintf(op->fontsize18_begin);
|
||||
outstring+=QString().sprintf("%s", op->fontsize18_begin);
|
||||
found_std_expr = TRUE;
|
||||
}
|
||||
break;
|
||||
case 24:
|
||||
if (op->fontsize24_begin) {
|
||||
outstring+=QString().sprintf(op->fontsize24_begin);
|
||||
outstring+=QString().sprintf("%s", op->fontsize24_begin);
|
||||
found_std_expr = TRUE;
|
||||
}
|
||||
break;
|
||||
case 36:
|
||||
if (op->fontsize36_begin) {
|
||||
outstring+=QString().sprintf(op->fontsize36_begin);
|
||||
outstring+=QString().sprintf("%s", op->fontsize36_begin);
|
||||
found_std_expr = TRUE;
|
||||
}
|
||||
break;
|
||||
case 48:
|
||||
if (op->fontsize48_begin) {
|
||||
outstring+=QString().sprintf(op->fontsize48_begin);
|
||||
outstring+=QString().sprintf("%s", op->fontsize48_begin);
|
||||
found_std_expr = TRUE;
|
||||
}
|
||||
break;
|
||||
@@ -300,46 +300,46 @@ op_begin_std_fontsize (OutputPersonality *op, int size)
|
||||
* size.
|
||||
*/
|
||||
if (size<9 && op->fontsize8_begin) {
|
||||
outstring+=QString().sprintf(op->fontsize8_begin);
|
||||
outstring+=QString().sprintf("%s", op->fontsize8_begin);
|
||||
} else
|
||||
if (size<11 && op->fontsize10_begin) {
|
||||
outstring+=QString().sprintf(op->fontsize10_begin);
|
||||
outstring+=QString().sprintf("%s", op->fontsize10_begin);
|
||||
} else
|
||||
if (size<13 && op->fontsize12_begin) {
|
||||
outstring+=QString().sprintf(op->fontsize12_begin);
|
||||
outstring+=QString().sprintf("%s", op->fontsize12_begin);
|
||||
} else
|
||||
if (size<16 && op->fontsize14_begin) {
|
||||
outstring+=QString().sprintf(op->fontsize14_begin);
|
||||
outstring+=QString().sprintf("%s", op->fontsize14_begin);
|
||||
} else
|
||||
if (size<21 && op->fontsize18_begin) {
|
||||
outstring+=QString().sprintf(op->fontsize18_begin);
|
||||
outstring+=QString().sprintf("%s", op->fontsize18_begin);
|
||||
} else
|
||||
if (size<30 && op->fontsize24_begin) {
|
||||
outstring+=QString().sprintf(op->fontsize24_begin);
|
||||
outstring+=QString().sprintf("%s", op->fontsize24_begin);
|
||||
} else
|
||||
if (size<42 && op->fontsize36_begin) {
|
||||
outstring+=QString().sprintf(op->fontsize36_begin);
|
||||
outstring+=QString().sprintf("%s", op->fontsize36_begin);
|
||||
} else
|
||||
if (size>40 && op->fontsize48_begin) {
|
||||
outstring+=QString().sprintf(op->fontsize48_begin);
|
||||
outstring+=QString().sprintf("%s", op->fontsize48_begin);
|
||||
} else
|
||||
/* If we can't even produce a good approximation,
|
||||
* just try to get a font size near 12 point.
|
||||
*/
|
||||
if (op->fontsize12_begin)
|
||||
outstring+=QString().sprintf(op->fontsize12_begin);
|
||||
outstring+=QString().sprintf("%s", op->fontsize12_begin);
|
||||
else
|
||||
if (op->fontsize14_begin)
|
||||
outstring+=QString().sprintf(op->fontsize14_begin);
|
||||
outstring+=QString().sprintf("%s", op->fontsize14_begin);
|
||||
else
|
||||
if (op->fontsize10_begin)
|
||||
outstring+=QString().sprintf(op->fontsize10_begin);
|
||||
outstring+=QString().sprintf("%s", op->fontsize10_begin);
|
||||
else
|
||||
if (op->fontsize18_begin)
|
||||
outstring+=QString().sprintf(op->fontsize18_begin);
|
||||
outstring+=QString().sprintf("%s", op->fontsize18_begin);
|
||||
else
|
||||
if (op->fontsize8_begin)
|
||||
outstring+=QString().sprintf(op->fontsize8_begin);
|
||||
outstring+=QString().sprintf("%s", op->fontsize8_begin);
|
||||
else
|
||||
error_handler ("output personality lacks sufficient font size change capability");
|
||||
}
|
||||
@@ -367,49 +367,49 @@ op_end_std_fontsize (OutputPersonality *op, int size)
|
||||
switch (size) {
|
||||
case 8:
|
||||
if (op->fontsize8_end) {
|
||||
outstring+=QString().sprintf(op->fontsize8_end);
|
||||
outstring+=QString().sprintf("%s", op->fontsize8_end);
|
||||
found_std_expr = TRUE;
|
||||
}
|
||||
break;
|
||||
case 10:
|
||||
if (op->fontsize10_end) {
|
||||
outstring+=QString().sprintf(op->fontsize10_end);
|
||||
outstring+=QString().sprintf("%s", op->fontsize10_end);
|
||||
found_std_expr = TRUE;
|
||||
}
|
||||
break;
|
||||
case 12:
|
||||
if (op->fontsize12_end) {
|
||||
outstring+=QString().sprintf(op->fontsize12_end);
|
||||
outstring+=QString().sprintf("%s", op->fontsize12_end);
|
||||
found_std_expr = TRUE;
|
||||
}
|
||||
break;
|
||||
case 14:
|
||||
if (op->fontsize14_end) {
|
||||
outstring+=QString().sprintf(op->fontsize14_end);
|
||||
outstring+=QString().sprintf("%s", op->fontsize14_end);
|
||||
found_std_expr = TRUE;
|
||||
}
|
||||
break;
|
||||
case 18:
|
||||
if (op->fontsize18_end) {
|
||||
outstring+=QString().sprintf(op->fontsize18_end);
|
||||
outstring+=QString().sprintf("%s", op->fontsize18_end);
|
||||
found_std_expr = TRUE;
|
||||
}
|
||||
break;
|
||||
case 24:
|
||||
if (op->fontsize24_end) {
|
||||
outstring+=QString().sprintf(op->fontsize24_end);
|
||||
outstring+=QString().sprintf("%s", op->fontsize24_end);
|
||||
found_std_expr = TRUE;
|
||||
}
|
||||
break;
|
||||
case 36:
|
||||
if (op->fontsize36_end) {
|
||||
outstring+=QString().sprintf(op->fontsize36_end);
|
||||
outstring+=QString().sprintf("%s", op->fontsize36_end);
|
||||
found_std_expr = TRUE;
|
||||
}
|
||||
break;
|
||||
case 48:
|
||||
if (op->fontsize48_end) {
|
||||
outstring+=QString().sprintf(op->fontsize48_end);
|
||||
outstring+=QString().sprintf("%s", op->fontsize48_end);
|
||||
found_std_expr = TRUE;
|
||||
}
|
||||
break;
|
||||
@@ -429,46 +429,46 @@ op_end_std_fontsize (OutputPersonality *op, int size)
|
||||
* size.
|
||||
*/
|
||||
if (size<9 && op->fontsize8_end) {
|
||||
outstring+=QString().sprintf(op->fontsize8_end);
|
||||
outstring+=QString().sprintf("%s", op->fontsize8_end);
|
||||
} else
|
||||
if (size<11 && op->fontsize10_end) {
|
||||
outstring+=QString().sprintf(op->fontsize10_end);
|
||||
outstring+=QString().sprintf("%s", op->fontsize10_end);
|
||||
} else
|
||||
if (size<13 && op->fontsize12_end) {
|
||||
outstring+=QString().sprintf(op->fontsize12_end);
|
||||
outstring+=QString().sprintf("%s", op->fontsize12_end);
|
||||
} else
|
||||
if (size<16 && op->fontsize14_end) {
|
||||
outstring+=QString().sprintf(op->fontsize14_end);
|
||||
outstring+=QString().sprintf("%s", op->fontsize14_end);
|
||||
} else
|
||||
if (size<21 && op->fontsize18_end) {
|
||||
outstring+=QString().sprintf(op->fontsize18_end);
|
||||
outstring+=QString().sprintf("%s", op->fontsize18_end);
|
||||
} else
|
||||
if (size<30 && op->fontsize24_end) {
|
||||
outstring+=QString().sprintf(op->fontsize24_end);
|
||||
outstring+=QString().sprintf("%s", op->fontsize24_end);
|
||||
} else
|
||||
if (size<42 && op->fontsize36_end) {
|
||||
outstring+=QString().sprintf(op->fontsize36_end);
|
||||
outstring+=QString().sprintf("%s", op->fontsize36_end);
|
||||
} else
|
||||
if (size>40 && op->fontsize48_end) {
|
||||
outstring+=QString().sprintf(op->fontsize48_end);
|
||||
outstring+=QString().sprintf("%s", op->fontsize48_end);
|
||||
} else
|
||||
/* If we can't even produce a good approximation,
|
||||
* just try to get a font size near 12 point.
|
||||
*/
|
||||
if (op->fontsize12_end)
|
||||
outstring+=QString().sprintf(op->fontsize12_end);
|
||||
outstring+=QString().sprintf("%s", op->fontsize12_end);
|
||||
else
|
||||
if (op->fontsize14_end)
|
||||
outstring+=QString().sprintf(op->fontsize14_end);
|
||||
outstring+=QString().sprintf("%s", op->fontsize14_end);
|
||||
else
|
||||
if (op->fontsize10_end)
|
||||
outstring+=QString().sprintf(op->fontsize10_end);
|
||||
outstring+=QString().sprintf("%s", op->fontsize10_end);
|
||||
else
|
||||
if (op->fontsize18_end)
|
||||
outstring+=QString().sprintf(op->fontsize18_end);
|
||||
outstring+=QString().sprintf("%s", op->fontsize18_end);
|
||||
else
|
||||
if (op->fontsize8_end)
|
||||
outstring+=QString().sprintf(op->fontsize8_end);
|
||||
outstring+=QString().sprintf("%s", op->fontsize8_end);
|
||||
else
|
||||
error_handler ("output personality lacks sufficient font size change capability");
|
||||
}
|
||||
|
||||
@@ -569,7 +569,7 @@ Fl_File_Chooser::fileNameCB()
|
||||
}
|
||||
} else {
|
||||
// File doesn't exist, so beep at and alert the user...
|
||||
fl_alert(existing_file_label);
|
||||
fl_alert("%s", existing_file_label);
|
||||
}
|
||||
}
|
||||
else if (Fl::event_key() != FL_Delete &&
|
||||
@@ -757,7 +757,7 @@ Fl_File_Chooser::newdir()
|
||||
|
||||
|
||||
// Get a directory name from the user
|
||||
if ((dir = fl_input(new_directory_label, NULL)) == NULL)
|
||||
if ((dir = fl_input("%s", new_directory_label, NULL)) == NULL)
|
||||
return;
|
||||
|
||||
// Make it relative to the current directory as needed...
|
||||
@@ -928,7 +928,7 @@ Fl_File_Chooser::showChoiceCB()
|
||||
item = showChoice->text(showChoice->value());
|
||||
|
||||
if (strcmp(item, custom_filter_label) == 0) {
|
||||
if ((item = fl_input(custom_filter_label, pattern_)) != NULL) {
|
||||
if ((item = fl_input("%s",custom_filter_label, pattern_)) != NULL) {
|
||||
strlcpy(pattern_, item, sizeof(pattern_));
|
||||
|
||||
quote_pathname(temp, item, sizeof(temp));
|
||||
|
||||
Reference in New Issue
Block a user