case 's':
if (cflags != DP_C_WCHAR) {
strvalue = va_arg(args, char *);
+ if (!strvalue) {
+ strvalue = (char *)"<NULL>";
+ }
currlen = fmtstr(buffer, currlen, maxlen, strvalue, flags, min, max);
} else {
/* %ls means to edit wide characters */
wstrvalue = va_arg(args, wchar_t *);
+ if (!wstrvalue) {
+ wstrvalue = (wchar_t *)L"<NULL>";
+ }
currlen = fmtwstr(buffer, currlen, maxlen, wstrvalue, flags, min, max);
}
break;
} else if (max < 0) {
max = maxlen;
}
- if (!value) {
- value = "<NULL>";
- }
strln = strlen(value);
if (strln > max) {
strln = max; /* truncate to max */
} else if (max < 0) {
max = maxlen;
}
- if (!value) {
- value = L"<NULL>";
- }
strln = wcslen(value);
if (strln > max) {
strln = max; /* truncate to max */
if (!result) {
r_length = 0;
+ dummy[0] = 0;
result = dummy;
} else {
r_length = strlen(result);