mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-14 17:47:33 -05:00
A few new minor utility functions.
A function to compare two strings _both_ in ptrlen form (I've had ptrlen_eq_string for ages, but for some reason, never quite needed ptrlen_eq_ptrlen). A function to ask whether one ptrlen starts with another (and, optionally, return a ptrlen giving the remaining part of the longer string). And the va_list version of logeventf, which I really ought to have written in the first place by sheer habit, even if it was only needed by logeventf itself.
This commit is contained in:
@ -256,15 +256,18 @@ void logevent_and_free(LogContext *ctx, char *event)
|
||||
sfree(event);
|
||||
}
|
||||
|
||||
void logeventvf(LogContext *ctx, const char *fmt, va_list ap)
|
||||
{
|
||||
logevent_and_free(ctx, dupvprintf(fmt, ap));
|
||||
}
|
||||
|
||||
void logeventf(LogContext *ctx, const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
char *buf;
|
||||
|
||||
va_start(ap, fmt);
|
||||
buf = dupvprintf(fmt, ap);
|
||||
logeventvf(ctx, fmt, ap);
|
||||
va_end(ap);
|
||||
logevent_and_free(ctx, buf);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user