How to fix warning – Unbound scanf conversion. This is how I am trying to fix this:
void Class::func1(
const string &item_as_string,
unsigned int &unit_id,
unsigned int &subprogam_id,
string &slotDescription
)
{
string bitset_flags;
const char *line_pointer = item_as_string.c_str();
unsigned int i, length = item_as_string.length();
unit_id = 0;
subprogram_id = 0;
slotDescription = "";
valid_line = false;
boost::scoped_array<char> flags( new char[length+1] );
flags[0]=0;
boost::scoped_array<char> slotDescriptionPtr( new char[length+1] );
slotDescriptionPtr[0]=0;
int val;
// QString pattern("%u,%u %1%s %1%s");
val = sscanf ( line_pointer, QString("%u,%u %1%s %2%s").arg(length+1).arg(length+1).toStdString().c_str(),
&unit_id, &subprogram_id, flags.get(), slotDescriptionPtr.get() );
}
I need help in this line of code :
val = sscanf ( line_pointer, QString("%u,%u %1%s %2%s").arg(length+1).arg(length+1).toStdString().c_str(),
&unit_id, &subprogram_id, flags.get(), slotDescriptionPtr.get() );