shithub: riscv

Download patch

ref: 5d58b9573cc4ea97f569735c1a61be48c27e6728
parent: ac3e3c342fc32cd633599d85391827289b7ebdf5
author: cinap_lenrek <[email protected]>
date: Sun Feb 24 23:15:43 EST 2019

cc: fix %.*s format usage in lexer "token too long" error

--- a/sys/src/cmd/cc/lex.c
+++ b/sys/src/cmd/cc/lex.c
@@ -937,7 +937,7 @@
 	return LDCONST;
 
 toolong:
-	yyerror("token too long: %.*s...", (int)(cp-symb), symb);
+	yyerror("token too long: %.*s...", utfnlen(symb, cp-symb), symb);
 	errorexit();
 	return -1;
 }