diff --git a/src/port/snprintf.c b/src/port/snprintf.c index 54b32de6043..bb28a88b71c 100644 --- a/src/port/snprintf.c +++ b/src/port/snprintf.c @@ -775,8 +775,9 @@ nextch2: strvalue = argvalues[fmtpos].cptr; else strvalue = va_arg(args, char *); - /* Whine if someone tries to print a NULL string */ - Assert(strvalue != NULL); + /* If string is NULL, silently substitute "(null)" */ + if (strvalue == NULL) + strvalue = "(null)"; fmtstr(strvalue, leftjust, fieldwidth, precision, pointflag, target); break;