changelog shortlog tags branches files raw gz bz2 help

Mercurial > hg > plan9front / changeset: upas/smtp: fix %.*s format for challenge in smtpcram()

changeset 7041: a80696e30622
parent 7040: 7352fb6f49ce
child 7042: 4564c92bb864
author: cinap_lenrek@felloff.net
date: Mon, 25 Feb 2019 03:29:19 +0100
files: sys/src/cmd/upas/smtp/smtp.c
description: upas/smtp: fix %.*s format for challenge in smtpcram()

the challenge should already be in ASCII format,
but better safe than sorry.
     1.1--- a/sys/src/cmd/upas/smtp/smtp.c
     1.2+++ b/sys/src/cmd/upas/smtp/smtp.c
     1.3@@ -474,7 +474,7 @@ smtpcram(DS *ds)
     1.4 		return "cannot find user name";
     1.5 	for(i = 0; i < n; i++)
     1.6 		rbuf[i] = tolower(rbuf[i]);
     1.7-	l = snprint(ubuf, sizeof ubuf, "%s %.*s", usr, n, rbuf);
     1.8+	l = snprint(ubuf, sizeof ubuf, "%s %.*s", usr, utfnlen(rbuf, n), rbuf);
     1.9 	snprint(ebuf, sizeof ebuf, "%.*[", l, ubuf);
    1.10 
    1.11 	dBprint("%s\r\n", ebuf);