Update main.cpp

size<=0 handled!!