* src/pic16/gen.c (pic16_freeAsmop): avoid NULL pointer dereference,
[fw/sdcc] / device / lib / pic16 / libc / stdio / vsprintf.c
index 16e930d4bc51cce7aebff96ff802095f04316bae..57259e51e0685ddbdf6109bed55ab57728a6a62f 100644 (file)
@@ -37,8 +37,8 @@ vsprintf (char *ebuf, const char *fmt, va_list ap)
 {
   unsigned int i;
 
-  i = vfprintf((FILE *) &ebuf, fmt, ap);
-  *ebuf = '\0';
+  i = vfprintf((FILE *) ebuf, fmt, ap);
+  ebuf[i] = '\0';
 
   return i;
 }