git: 9front

Download patch

ref: 4afb4720be9c5290584eadf1bbd0614d73814e06
parent: d242af5255289384755eba7a4df47870599a2a1a
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sun Feb 24 23:18:30 EST 2019

aux/depend: fix %.*s format in path concatenation

--- a/sys/src/cmd/aux/depend.c
+++ b/sys/src/cmd/aux/depend.c
@@ -1379,7 +1379,9 @@
 	f->use++;
 	if(f->fd < 0){
 		name = strrchr(df->path, '/') + 1;
-		n = snprint(path, sizeof path, "%.*s/%s", (int)(name-df->path), df->path, f->name);
+		n = snprint(path, sizeof path, "%.*s/%s", 
+			utfnlen(df->path, name-df->path), df->path,
+			f->name);
 		if(n >= sizeof path - UTFmax){
 			syslog(0, dependlog, "path name too long: %.20s.../%.20s...", df->path, f->name);
 			return -1;
--