You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In ringbuffer.c, and in exercise 44 of LCTHW, you have a couple instances similar to:
void *result = memcpy(buffer->buffer + buffer->end, data, length);
check(result != NULL, "Failed to write data into buffer.");
However, memcpy merely returns 'dest'. The return value is not indicative of success or failure in any way. Checking it against null is harmless but seems like a bug, and may mislead readers as to how memcpy works.
In ringbuffer.c, and in exercise 44 of LCTHW, you have a couple instances similar to:
However, memcpy merely returns 'dest'. The return value is not indicative of success or failure in any way. Checking it against null is harmless but seems like a bug, and may mislead readers as to how memcpy works.
I was alerted to this issue in the comments section of a recent Hacker News post: https://news.ycombinator.com/item?id=8059283
The text was updated successfully, but these errors were encountered: