src/format.cpp

changeset 141
68d60e2cfa76
parent 138
a426c1039655
equal deleted inserted replaced
140:04a6eb68f226 141:68d60e2cfa76
84 "modifier after '%%'", pos); 84 "modifier after '%%'", pos);
85 } 85 }
86 86
87 int i = fmt[pos + ofs] - '0'; 87 int i = fmt[pos + ofs] - '0';
88 88
89 if (i > static_cast<signed> (args.size())) 89 #ifdef DEBUG
90 if (i == 0)
91 formatError (fmtstr, "%0 in format string", pos);
92 #endif
93
94 if (i > int (args.size()))
90 formatError (fmtstr, String ("Format argument #") + i + " used but not defined.", pos); 95 formatError (fmtstr, String ("Format argument #") + i + " used but not defined.", pos);
91 96
92 String replacement = args[i - 1]; 97 String replacement = args[i - 1];
93 98
94 switch (mod) 99 switch (mod)

mercurial