upas/scanmail: fix %.*s format in xprint(), improve mkfile

front
cinap_lenrek 2019-02-25 03:31:50 +01:00
parent e3aee39a38
commit 536805bce3
2 changed files with 6 additions and 2 deletions

View File

@ -624,7 +624,10 @@ xprint(int fd, char *type, Resub *m)
while(*q && *q != ' ')
q++;
fprint(fd, "%s %.*s~%.*s~%.*s\n", type, (int)(m->sp-p), p, (int)(m->ep-m->sp), m->sp, (int)(q-m->ep), m->ep);
fprint(fd, "%s %.*s~%.*s~%.*s\n", type,
utfnlen(p, m->sp-p), p,
utfnlen(m->sp, m->ep-m->sp), m->sp,
utfnlen(m->ep, q-m->ep), m->ep);
}
enum {

View File

@ -1,5 +1,4 @@
</$objtype/mkfile
<../mkupas
TARG=scanmail\
testscan
@ -20,5 +19,7 @@ UPDATE=\
</sys/src/cmd/mkmany
CFLAGS=$CFLAGS -I../common
<../mkupas
scanmail.$O: scanmail.c
$CC $CFLAGS scanmail.c