Skip to content

Commit 0fc758d

Browse files
committed
[little test]
1 parent 6a248a8 commit 0fc758d

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

driver/config.d

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -240,11 +240,9 @@ struct Parser
240240

241241
void error(in string msg, int lineNum)
242242
{
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);
243+
char[20] buf = void;
244+
auto len = snprintf(buf.ptr, buf.length, "line %d: ", lineNum);
245+
throw new Exception(buf[0 .. len] ~ msg);
248246
}
249247

250248
char getChar()

0 commit comments

Comments
 (0)