Skip to content

Commit

Permalink
Fix gcc compilation issue
Browse files Browse the repository at this point in the history
For fedora os-like, you have compilation issue:

"""bash
error: format not a string literal and no format arguments [-Werror=format-security]
"""

it's come from code like:

"""c++
fprintf(stderr,err.ascii());
"""

to avoid that use fix like:

"""c++
fprintf(stderr, "%s", err.ascii());
"""
  • Loading branch information
rox-radiolarg56 committed Apr 19, 2021
1 parent 64fbb53 commit 3c53f06
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion rdadmin/rdadmin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ void PrintError(const QString &str,bool interactive)
QMessageBox::warning(NULL,QObject::tr("RDAdmin Error"),str);
}
else {
fprintf(stderr,QString().sprintf("rdadmin: %s\n",(const char *)str));
fprintf(stderr,"%s",QString().sprintf("rdadmin: %s\n",(const char *)str));
}
}

Expand Down
2 changes: 1 addition & 1 deletion tests/datedecode_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ MainObject::MainObject(QObject *parent)
//
QString err (tr("datedecode_test: "));
if(!RDOpenDb(&schema,&err,config)) {
fprintf(stderr,err.ascii());
fprintf(stderr,"%s", err.ascii());
delete cmd;
exit(256);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/log_unlink_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ MainObject::MainObject(QObject *parent)
//
QString err (tr("upload_test: "));
if(!RDOpenDb(&schema,&err,test_config)) {
fprintf(stderr,err.ascii());
fprintf(stderr,"%s", err.ascii());
delete cmd;
exit(256);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/reserve_carts_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ MainObject::MainObject(QObject *parent)
//
QString err (tr("upload_test: "));
if(!RDOpenDb(&schema,&err,config)) {
fprintf(stderr,err.ascii());
fprintf(stderr,"%s", err.ascii());
delete cmd;
exit(256);
}
Expand Down
2 changes: 1 addition & 1 deletion utils/rdalsaconfig/rdalsamodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ bool RDAlsaModel::saveConfig(const QString &filename)
return false;
}
for(int i=0;i<model_other_lines.size();i++) {
fprintf(f,model_other_lines.at(i));
fprintf(f,"%s", model_other_lines.at(i));
}
fprintf(f,"%s\n",START_MARKER);
for(int i=0;i<model_alsa_cards.size();i++) {
Expand Down

0 comments on commit 3c53f06

Please sign in to comment.