Explorar el Código

Catch attempts to print NULL strings

tags/v0.9.3
Michael Brown hace 17 años
padre
commit
19e1d674d3
Se han modificado 1 ficheros con 2 adiciones y 0 borrados
  1. 2
    0
      src/core/vsprintf.c

+ 2
- 0
src/core/vsprintf.c Ver fichero

@@ -219,6 +219,8 @@ size_t vcprintf ( struct printf_context *ctx, const char *fmt, va_list args ) {
219 219
 			cputchar ( ctx, va_arg ( args, unsigned int ) );
220 220
 		} else if ( *fmt == 's' ) {
221 221
 			ptr = va_arg ( args, char * );
222
+			if ( ! ptr )
223
+				ptr = "<NULL>";
222 224
 		} else if ( *fmt == 'p' ) {
223 225
 			intptr_t ptrval;
224 226
 

Loading…
Cancelar
Guardar