From: danw Date: Sun, 29 Sep 1996 19:58:09 +0000 (+0000) Subject: Don't truncate query arguments at 40 characters in logs X-Git-Tag: MOIRA3_FINAL~28 X-Git-Url: http://andersk.mit.edu/gitweb/moira.git/commitdiff_plain/3b2aae4c8a1ed7d877b4c16b3009d252f388cc75 Don't truncate query arguments at 40 characters in logs --- diff --git a/server/mr_util.c b/server/mr_util.c index 47f7cc6c..8855b0c9 100644 --- a/server/mr_util.c +++ b/server/mr_util.c @@ -29,7 +29,7 @@ requote(buf, cp, len) register unsigned char c; if (len <= 2) return buf; *buf++ = '"'; count++; len--; - for(; (count < 40) && (len > 1) && (c = *cp); + for(; (count < 258) && (len > 1) && (c = *cp); cp++, --len, ++count) { if (c == '\\' || c == '"') *buf++ = '\\'; if (isprint(c)) *buf++ = c; @@ -39,11 +39,6 @@ requote(buf, cp, len) } } if (len > 1) { *buf++ = '"'; count++; len--; } - if (len > 3 && count >= 40) { - *buf++ = '.'; count++; len--; - *buf++ = '.'; count++; len--; - *buf++ = '.'; count++; len--; - } if (len > 1) *buf = '\0'; return buf; } @@ -62,12 +57,12 @@ log_args(tag, version, argc, argv) sprintf(buf, "%s[%d]: ", tag, version); for (bp = buf; *bp; bp++); - for (i = 0; i < argc && ((buf - bp) + 1024) > 2; i++) { + for (i = 0; i < argc && ((buf - bp) + BUFSIZ) > 2; i++) { if (i != 0) { *bp++ = ','; *bp++ = ' '; } - bp = requote(bp, argv[i], (buf - bp) + 1024); + bp = requote(bp, argv[i], (buf - bp) + BUFSIZ); } *bp = '\0'; com_err(whoami, 0, "%s", buf);