Home » U++ Library support » U++ Core » NFormat should check if args were left
NFormat should check if args were left [message #2501] |
Sat, 15 April 2006 09:48 |
hans
Messages: 44 Registered: March 2006 Location: Germany
|
Member |
|
|
IMHO the NFormat function should check if any args were not printed, so NFormat("%n", 23, 43) will bugcheck.
Could be something like (in format.cpp)
RegisterValueFormatter(L"vt", &StdFormatFormatter);
...
...
if(*s == '\0') {
#ifdef _DEBUG
if (pos < v.GetCount()) {
LOG("Not enough formatter: " << pos << " but " << v.GetCount() << " arg(s)");
NEVER();
}
#else
if (pos < v.GetCount()) {
result << " !MOREARGS! ";
for (int i= pos; i < v.GetCount(); ++i)
result << v[i] << ' ';
}
#endif
return result;
}
|
|
|
Goto Forum:
Current Time: Thu May 09 17:56:25 CEST 2024
Total time taken to generate the page: 0.02353 seconds
|