We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6a248a8 commit 0fc758dCopy full SHA for 0fc758d
driver/config.d
@@ -240,11 +240,9 @@ struct Parser
240
241
void error(in string msg, int lineNum)
242
{
243
- enum fmt = "line %d: %.*s";
244
- char[1024] buf;
245
- auto len = snprintf(buf.ptr, buf.length, fmt,
246
- lineNum, cast(int) msg.length, msg.ptr);
247
- throw new Exception(buf[0 .. len].idup);
+ char[20] buf = void;
+ auto len = snprintf(buf.ptr, buf.length, "line %d: ", lineNum);
+ throw new Exception(buf[0 .. len] ~ msg);
248
}
249
250
char getChar()
0 commit comments