From e3aee39a389700ad821a1619f114e226c1bd42d0 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Mon, 25 Feb 2019 03:29:19 +0100 Subject: upas/smtp: fix %.*s format for challenge in smtpcram() the challenge should already be in ASCII format, but better safe than sorry. --- sys/src/cmd/upas/smtp/smtp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/src/cmd/upas/smtp/smtp.c b/sys/src/cmd/upas/smtp/smtp.c index 579751255..db8febfec 100644 --- a/sys/src/cmd/upas/smtp/smtp.c +++ b/sys/src/cmd/upas/smtp/smtp.c @@ -474,7 +474,7 @@ smtpcram(DS *ds) return "cannot find user name"; for(i = 0; i < n; i++) rbuf[i] = tolower(rbuf[i]); - l = snprint(ubuf, sizeof ubuf, "%s %.*s", usr, n, rbuf); + l = snprint(ubuf, sizeof ubuf, "%s %.*s", usr, utfnlen(rbuf, n), rbuf); snprint(ebuf, sizeof ebuf, "%.*[", l, ubuf); dBprint("%s\r\n", ebuf); -- cgit v1.2.3