Fixed a potential buffer overflow.