'\0' を含んだ文字列を標準入力から読む時

char buf[10000] = {0};
char *p = buf;
int ret;

while (ret = read(0, p, 100) > 0) {
p += ret;
}

これで合ってますか?