changelog shortlog tags branches files raw gz bz2 help

Mercurial > hg > plan9front / changeset: upas/scanmail: fix %.*s format in xprint(), improve mkfile

changeset 7042: 4564c92bb864
parent 7041: a80696e30622
child 7043: ee85e5437edf
author: cinap_lenrek@felloff.net
date: Mon, 25 Feb 2019 03:31:50 +0100
files: sys/src/cmd/upas/scanmail/common.c sys/src/cmd/upas/scanmail/mkfile
description: upas/scanmail: fix %.*s format in xprint(), improve mkfile
     1.1--- a/sys/src/cmd/upas/scanmail/common.c
     1.2+++ b/sys/src/cmd/upas/scanmail/common.c
     1.3@@ -624,7 +624,10 @@ xprint(int fd, char *type, Resub *m)
     1.4 	while(*q && *q != ' ')
     1.5 		q++;
     1.6 
     1.7-	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);
     1.8+	fprint(fd, "%s %.*s~%.*s~%.*s\n", type, 
     1.9+		utfnlen(p, m->sp-p), p,
    1.10+		utfnlen(m->sp, m->ep-m->sp), m->sp,
    1.11+		utfnlen(m->ep, q-m->ep), m->ep);
    1.12 }
    1.13 
    1.14 enum {
     2.1--- a/sys/src/cmd/upas/scanmail/mkfile
     2.2+++ b/sys/src/cmd/upas/scanmail/mkfile
     2.3@@ -1,5 +1,4 @@
     2.4 </$objtype/mkfile
     2.5-<../mkupas
     2.6 
     2.7 TARG=scanmail\
     2.8 	testscan
     2.9@@ -20,5 +19,7 @@ UPDATE=\
    2.10 </sys/src/cmd/mkmany
    2.11 CFLAGS=$CFLAGS -I../common
    2.12 
    2.13+<../mkupas
    2.14+
    2.15 scanmail.$O:	scanmail.c
    2.16 	$CC $CFLAGS scanmail.c