change buf and malloc size