don't write to NULL buffer

If we have checked for allocation failure, no need to write to buffer.

CID 1100648
This commit is contained in:
Sebastian Dransfeld 2014-03-24 13:37:07 +01:00
parent fe45b5c73f
commit 1c53e10b42
1 changed files with 7 additions and 4 deletions

View File

@ -123,10 +123,13 @@ _handle_buf(Termpty *ty, const Eina_Unicode *codepoints, int len)
{
ERR("memerr");
}
bytes = (char *)ce - (char *)c;
memcpy(ty->buf, c, bytes);
ty->buflen = bytes / sizeof(Eina_Unicode);
ty->buf[ty->buflen] = 0;
else
{
bytes = (char *)ce - (char *)c;
memcpy(ty->buf, c, bytes);
ty->buflen = bytes / sizeof(Eina_Unicode);
ty->buf[ty->buflen] = 0;
}
break;
}
c += n;