]> andersk Git - moira.git/commitdiff
Don't truncate query arguments at 40 characters in logs
authordanw <danw>
Sun, 29 Sep 1996 19:58:09 +0000 (19:58 +0000)
committerdanw <danw>
Sun, 29 Sep 1996 19:58:09 +0000 (19:58 +0000)
server/mr_util.c

index 47f7cc6cf17fae8e56fa1d80c4b85b23816ce1d0..8855b0c95fa2937b877530082493d5ae6541cb3a 100644 (file)
@@ -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);
This page took 0.040447 seconds and 5 git commands to generate.