How to detect if the buffer is too small for strcpy()?
Usually this is pretty easy:
Code:
void do_copy(char* str)
{
    char buffer[BUFFER_SIZE];
    size_t size = strlen(str);
    if(size >= BUFFER_SIZE)
    {
        /* Error, buffer is too small */
    }
    else
    {
        strcpy(buffer, str);
    }
    // ...
}