In C, if (auto) variables are not explicitly set, they can contain any value, not just zero, even though it is common. An int for instance is often 0 if not set, but can actually be any value. The same goes for all types, including char arrays.
str in this case may contain anything, i.e. it may not be empty. It is not initialized, so your assert for the strcmp with "" can hit you.
Also, as Paul R pointed out, the logic for assert() is inverse to what strcmp() returns. 0 means success for strcmp() but failure to assert().
This can instead be written as:
assert(0 == strcmp(str, "hello"));
or
assert(!strcmp(str, "hello"));
If you want to it to be empty, you can use a static declaration, like so:
static char str[BUFSIZ];
But static variables are only cleared the first the function runs. If you want str to start out empty, you have to empty explicitly each time,
like so, the most efficient way and prettiest way (As Paul R noted):
char str[BUFSIZE] = "";
which is equivalent to:
char str[BUFSIZE] = { 0 };
and can be done explicitly like this:
char str[BUFSIZ];
str[0] = '\0';
or so, maybe to most logical way to someone new to C:
char str[BUFSIZ];
strcpy(str, "");
or so, explicitly clearing all the array, least efficient and unnecessary:
char str[BUFSIZ];
memset(str, 0, sizeof (str));