Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to previous message
hans is currently offline  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;
      }
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Moveable classes with virtual functions/Documentation error
Next Topic: conversion between data of a cell of the arrayctrl to int
Goto Forum:
  


Current Time: Thu May 09 17:56:25 CEST 2024

Total time taken to generate the page: 0.02353 seconds