aux/depend: fix %.*s format in path concatenation
This commit is contained in:
parent
bc5b85c37c
commit
b4b4d2286b
1 changed files with 3 additions and 1 deletions
|
@ -1379,7 +1379,9 @@ getfile(Dfile *df, File *f)
|
||||||
f->use++;
|
f->use++;
|
||||||
if(f->fd < 0){
|
if(f->fd < 0){
|
||||||
name = strrchr(df->path, '/') + 1;
|
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){
|
if(n >= sizeof path - UTFmax){
|
||||||
syslog(0, dependlog, "path name too long: %.20s.../%.20s...", df->path, f->name);
|
syslog(0, dependlog, "path name too long: %.20s.../%.20s...", df->path, f->name);
|
||||||
return -1;
|
return -1;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue