Fixed pthreads infinite loop when string length was <= 0