*p++ = ' ';
for (i = 0; i < 16; i++)
- {
- sprintf(CS p, "%02x", digest[i]);
- p += 2;
- }
+ p += sprintf(CS p, "%02x", digest[i]);
/* Send the response, in base 64, and check the result. The response is
in big_buffer, but b64encode() returns its result in working store,
p = (uschar *)clear;
c = len;
while (c-- > 0)
- {
if ((x = *p++) < 33 || x > 127 || x == '+' || x == '=')
- {
- sprintf(CS pp, "+%.02x", x); /* There's always room */
- pp += 3;
- }
- else *pp++ = x;
- }
+ pp += sprintf(CS pp, "+%.02x", x); /* There's always room */
+ else
+ *pp++ = x;
*pp = 0;
return code;
{
time_t now = time(NULL);
struct tm *t = timestamps_utc? gmtime(&now) : localtime(&now);
- (void) sprintf(CS debug_ptr, "%02d:%02d:%02d ", t->tm_hour, t->tm_min,
+ debug_ptr += sprintf(CS debug_ptr, "%02d:%02d:%02d ", t->tm_hour, t->tm_min,
t->tm_sec);
- while(*debug_ptr != 0) debug_ptr++;
}
DEBUG(D_pid)
{
- sprintf(CS debug_ptr, "%5d ", (int)getpid());
- while(*debug_ptr != 0) debug_ptr++;
+ debug_ptr += sprintf(CS debug_ptr, "%5d ", (int)getpid());
}
/* Set up prefix if outputting for host checking and not debugging */
{
int j;
for (j = 0; j < 32; j += 4)
- {
- sprintf(CS pp, "%x.", (v6[i] >> j) & 15);
- pp += 2;
- }
+ pp += sprintf(CS pp, "%x.", (v6[i] >> j) & 15);
}
Ustrcpy(pp, "ip6.arpa.");
quote = US"";
while (*pp != 0) if (isspace(*pp++)) { quote = US"\""; break; }
}
- sprintf(CS p, " %s%.*s%s", quote, (int)(big_buffer_size -
+ p += sprintf(CS p, " %s%.*s%s", quote, (int)(big_buffer_size -
(p - big_buffer) - 4), printing, quote);
- while (*p) p++;
}
if (LOGGING(arguments))
if (mask < 0)
*tt = 0;
else
- {
- sprintf(CS tt, "/%d", mask);
- while (*tt) tt++;
- }
+ tt += sprintf(CS tt, "/%d", mask);
return tt - buffer;
}
}
}
- sprintf(CS ptr, "%s%s%s%s\n ",
+ ptr += sprintf(CS ptr, "%s%s%s%s\n ",
((flags & LOG_MAIN) != 0)? " MAIN" : "",
((flags & LOG_PANIC) != 0)? " PANIC" : "",
((flags & LOG_PANIC_DIE) == LOG_PANIC_DIE)? " DIE" : "",
((flags & LOG_REJECT) != 0)? " REJECT" : "");
- while(*ptr) ptr++;
if ((flags & LOG_CONFIG) != 0) ptr = log_config_info(ptr, flags);
va_start(ap, format);
}
else
{
- sprintf(CS t, "=%02X", ch);
- while (*t != 0) t++;
+ t += sprintf(CS t, "=%02X", ch);
coded = TRUE;
first_byte = !first_byte;
}
*p = 0;
p = big_buffer;
- sprintf(CS p, "pid=%d", (int)queue_run_pid);
- while (*p != 0) p++;
+ p += sprintf(CS p, "pid=%d", (int)queue_run_pid);
if (extras[0] != 0)
- {
- sprintf(CS p, " -q%s", extras);
- while (*p != 0) p++;
- }
+ p += sprintf(CS p, " -q%s", extras);
- if (deliver_selectstring != NULL)
- {
- sprintf(CS p, " -R%s %s", deliver_selectstring_regex? "r" : "",
+ if (deliver_selectstring)
+ p += sprintf(CS p, " -R%s %s", deliver_selectstring_regex? "r" : "",
deliver_selectstring);
- while (*p != 0) p++;
- }
- if (deliver_selectstring_sender != NULL)
- {
- sprintf(CS p, " -S%s %s", deliver_selectstring_sender_regex? "r" : "",
+ if (deliver_selectstring_sender)
+ p += sprintf(CS p, " -S%s %s", deliver_selectstring_sender_regex? "r" : "",
deliver_selectstring_sender);
- while (*p != 0) p++;
- }
log_detail = string_copy(big_buffer);
if (*queue_name)
/* If deliver_selectstring is a regex, compile it. */
-if (deliver_selectstring != NULL && deliver_selectstring_regex)
+if (deliver_selectstring && deliver_selectstring_regex)
selectstring_regex = regex_must_compile(deliver_selectstring, TRUE, FALSE);
-if (deliver_selectstring_sender != NULL && deliver_selectstring_sender_regex)
+if (deliver_selectstring_sender && deliver_selectstring_sender_regex)
selectstring_regex_sender =
regex_must_compile(deliver_selectstring_sender, TRUE, FALSE);
Ustrcat(p, "[ ");
p += 2;
for (i = 0; i < opt[1]; i++)
- {
- sprintf(CS p, "%2.2x ", opt[i]);
- p += 3;
- }
+ p += sprintf(CS p, "%2.2x ", opt[i]);
*p++ = ']';
}
opt += opt[1];
switch(length)
{
case L_SHORT:
- case L_NORMAL: sprintf(CS p, newformat, va_arg(ap, int)); break;
- case L_LONG: sprintf(CS p, newformat, va_arg(ap, long int)); break;
- case L_LONGLONG: sprintf(CS p, newformat, va_arg(ap, LONGLONG_T)); break;
- case L_SIZE: sprintf(CS p, newformat, va_arg(ap, size_t)); break;
+ case L_NORMAL: p += sprintf(CS p, newformat, va_arg(ap, int)); break;
+ case L_LONG: p += sprintf(CS p, newformat, va_arg(ap, long int)); break;
+ case L_LONGLONG: p += sprintf(CS p, newformat, va_arg(ap, LONGLONG_T)); break;
+ case L_SIZE: p += sprintf(CS p, newformat, va_arg(ap, size_t)); break;
}
- while (*p) p++;
break;
case 'p':
if (p >= last - 24) { yield = FALSE; goto END_FORMAT; }
strncpy(newformat, item_start, fp - item_start);
newformat[fp - item_start] = 0;
- sprintf(CS p, newformat, va_arg(ap, void *));
- while (*p) p++;
+ p += sprintf(CS p, newformat, va_arg(ap, void *));
break;
/* %f format is inherently insecure if the numbers that it may be
strncpy(newformat, item_start, fp - item_start);
newformat[fp-item_start] = 0;
if (length == L_LONGDOUBLE)
- sprintf(CS p, newformat, va_arg(ap, long double));
+ p += sprintf(CS p, newformat, va_arg(ap, long double));
else
- sprintf(CS p, newformat, va_arg(ap, double));
- while (*p) p++;
+ p += sprintf(CS p, newformat, va_arg(ap, double));
break;
/* String types */
bin, &sz)))
return g_err("gs0", __FUNCTION__, ret);
-for(dp = txt, sp = bin; sz; dp += 2, sp++, sz--)
- sprintf(CS dp, "%.2x", *sp);
+for(dp = txt, sp = bin; sz; sz--)
+ dp += sprintf(CS dp, "%.2x", *sp++);
for(sp = txt; sp[0]=='0' && sp[1]; ) sp++; /* leading zeroes */
return string_copy(sp);
}
if (gnutls_x509_crt_get_signature((gnutls_x509_crt_t)cert, CS cp1, &len) != 0)
return g_err("gs1", __FUNCTION__, ret);
-for(cp3 = cp2 = cp1+len; cp1 < cp2; cp3 += 3, cp1++)
- sprintf(CS cp3, "%.2x ", *cp1);
+for(cp3 = cp2 = cp1+len; cp1 < cp2; cp1++)
+ cp3 += sprintf(CS cp3, "%.2x ", *cp1);
cp3[-1]= '\0';
return cp2;
/* binary data, DER encoded */
/* just dump for now */
-for(cp3 = cp2 = cp1+siz; cp1 < cp2; cp3 += 3, cp1++)
- sprintf(CS cp3, "%.2x ", *cp1);
+for(cp3 = cp2 = cp1+siz; cp1 < cp2; cp1++)
+ cp3 += sprintf(CS cp3, "%.2x ", *cp1);
cp3[-1]= '\0';
return cp2;
if ((ret = gnutls_x509_crt_get_fingerprint(cert, algo, cp, &siz)) < 0)
return g_err("gf1", __FUNCTION__, ret);
-for (cp3 = cp2 = cp+siz; cp < cp2; cp++, cp3+=2)
- sprintf(CS cp3, "%02X",*cp);
+for (cp3 = cp2 = cp+siz; cp < cp2; cp++)
+ cp3 += sprintf(CS cp3, "%02X", *cp);
return cp2;
}
while(len)
{
- sprintf(CS cp2, "%.2x ", *cp1++);
- cp2 += 3;
+ cp2 += sprintf(CS cp2, "%.2x ", *cp1++);
len--;
}
cp2[-1] = '\0';