为output分配内存

This commit is contained in:
root 2018-04-03 07:42:50 -04:00
commit 95e74a3ffe

View file

@ -2157,7 +2157,8 @@ int main(int argc, char *argv[]) {
strcat(unsupported, "and "); strcat(unsupported, "and ");
strcat(unsupported, "regex support "); strcat(unsupported, "regex support ");
#endif #endif
output = malloc(sizeof(char) * 4096);
memset(output, 0, sizeof(char) * 4096);
(void) setvbuf(stdout, NULL, _IONBF, 0); (void) setvbuf(stdout, NULL, _IONBF, 0);
(void) setvbuf(stderr, NULL, _IONBF, 0); (void) setvbuf(stderr, NULL, _IONBF, 0);
// set defaults // set defaults