setbrk: possible paranoia for the moment
authorAlan Cox <alan@linux.intel.com>
Sat, 16 May 2015 19:09:04 +0000 (20:09 +0100)
committerAlan Cox <alan@linux.intel.com>
Sat, 16 May 2015 19:09:04 +0000 (20:09 +0100)
ensure our new sbrk space is clean

Applications/V7/cmd/sh/setbrk.c

index 618edf7..fe1b31a 100644 (file)
  */
 
 #include       "defs.h"
+#include       <string.h>
 
 void *setbrk(intptr_t incr)
 {
        uint8_t *a = sbrk(incr);
        brkend = a + incr;
+       if (a != (uint8_t *)-1)
+               memset(a, 0, incr);
        return a;
 }