From 751291fd62da691de3f0c25a8a9a464b4b8318c6 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Thu, 30 Jan 1997 21:41:36 +0000 Subject: Shroud password lengths. svn path=/trunk/; revision=848 --- driver.c | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) (limited to 'driver.c') diff --git a/driver.c b/driver.c index ee57a805..fd4e4155 100644 --- a/driver.c +++ b/driver.c @@ -1468,12 +1468,17 @@ va_dcl if (outlevel == O_VERBOSE) { - if (shroud) + char *cp; + + if (shroud && (cp = strstr(buf, shroud))) { - char *cp; + char *sp; - if ((cp = strstr(buf, shroud))) - memset(cp, '*', strlen(shroud)); + sp = cp + strlen(shroud); + *cp++ = '*'; + while (*sp) + *cp++ = *sp++; + *sp = '\0'; } buf[strlen(buf)-2] = '\0'; error(0, 0, "%s> %s", protocol->name, buf); @@ -1533,12 +1538,17 @@ va_dcl if (outlevel == O_VERBOSE) { - if (shroud) + char *cp; + + if (shroud && (cp = strstr(buf, shroud))) { - char *cp; + char *sp; - if ((cp = strstr(buf, shroud))) - memset(cp, '*', strlen(shroud)); + sp = cp + strlen(shroud); + *cp++ = '*'; + while (*sp) + *cp++ = *sp++; + *sp = '\0'; } buf[strlen(buf)-1] = '\0'; error(0, 0, "%s> %s", protocol->name, buf); -- cgit v1.2.3