Allow log functions to be called with ctx==NULL
This change allows functions to be used from places where there is no sc_context (ctx) available.
This commit is contained in:
parent
95ad11a253
commit
f93835add9
|
@ -73,9 +73,7 @@ static void sc_do_log_va(sc_context_t *ctx, int level, const char *file, int lin
|
|||
FILE *outf = NULL;
|
||||
int n;
|
||||
|
||||
assert(ctx != NULL);
|
||||
|
||||
if (ctx->debug < level)
|
||||
if (!ctx || ctx->debug < level)
|
||||
return;
|
||||
|
||||
p = buf;
|
||||
|
@ -167,9 +165,7 @@ void sc_hex_dump(struct sc_context *ctx, int level, const u8 * in, size_t count,
|
|||
char *p = buf;
|
||||
int lines = 0;
|
||||
|
||||
assert(ctx != NULL);
|
||||
|
||||
if (ctx->debug < level)
|
||||
if (!ctx || ctx->debug < level)
|
||||
return;
|
||||
|
||||
assert(buf != NULL && (in != NULL || count == 0));
|
||||
|
|
Loading…
Reference in New Issue