Fix buffer overflow in buffered I/O dowrite()
Fix buffer overflow in buffered I/O dowrite()

If the string to be written is larger than the buffer's resize increment (capacity * 3 / 2), not enough space would be allocated and an overflow occurs when the string is copied. This fix keeps incrementing the buffer size until there is enough room to hold the incoming string.

resetnow/premake-core,noresources/premake-core,noresources/premake-core,TurkeyMan/premake-core,martin-traverse/premake-core,Blizzard/premake-core,resetnow/premake-core,resetnow/premake-core,CodeAnxiety/premake-core,sleepingwit/premake-core,bravnsgaard/premake-core,Zefiros-Software/premake-core,Zefiros-Software/premake-core,noresources/premake-core,premake/premake-core,LORgames/premake-core,LORgames/premake-core,sleepingwit/premake-core,bravnsgaard/premake-core,TurkeyMan/premake-core,Blizzard/premake-core,xriss/premake-core,Blizzard/premake-core,xriss/premake-core,mendsley/premake-core,noresources/premake-core,tvandijck/premake-core,Zefiros-Software/premake-core,CodeAnxiety/premake-core,xriss/premake-core,aleksijuvani/premake-core,tvandijck/premake-core,starkos/premake-core,LORgames/premake-core,martin-traverse/premake-core,sleepingwit/premake-core,soundsrc/premake-core,CodeAnxiety/premake-core,TurkeyMan/premake-core,soundsrc/premake-core,aleksijuvani/premake-core,Blizzard/premake-core,tvandijck/premake-core,dcourtois/premake-core,soundsrc/premake-core,noresources/premake-core,premake/premake-core,lizh06/premake-core,Zefiros-Software/premake-core,TurkeyMan/premake-core,dcourtois/premake-core,LORgames/premake-core,premake/premake-core,mandersan/premake-core,jstewart-amd/premake-core,dcourtois/premake-core,starkos/premake-core,tvandijck/premake-core,mendsley/premake-core,dcourtois/premake-core,aleksijuvani/premake-core,aleksijuvani/premake-core,mendsley/premake-core,premake/premake-core,resetnow/premake-core,Zefiros-Software/premake-core,martin-traverse/premake-core,sleepingwit/premake-core,starkos/premake-core,premake/premake-core,mendsley/premake-core,soundsrc/premake-core,dcourtois/premake-core,Blizzard/premake-core,premake/premake-core,lizh06/premake-core,CodeAnxiety/premake-core,LORgames/premake-core,jstewart-amd/premake-core,mendsley/premake-core,sleepingwit/premake-core,jstewart-amd/premake-core,mandersan/premake-core,martin-traverse/premake-core,TurkeyMan/premake-core,starkos/premake-core,starkos/premake-core,bravnsgaard/premake-core,dcourtois/premake-core,mandersan/premake-core,dcourtois/premake-core,premake/premake-core,resetnow/premake-core,starkos/premake-core,noresources/premake-core,soundsrc/premake-core,bravnsgaard/premake-core,tvandijck/premake-core,lizh06/premake-core,bravnsgaard/premake-core,mandersan/premake-core,Blizzard/premake-core,noresources/premake-core,xriss/premake-core,CodeAnxiety/premake-core,jstewart-amd/premake-core,starkos/premake-core,xriss/premake-core,jstewart-amd/premake-core,mandersan/premake-core,aleksijuvani/premake-core,lizh06/premake-core