Alternative to using strncpy() as 'safe' version of strcpy() I am thinking of using this as part of a header file to give me a useful string-manipulation tool. Elements is size of dest to prevent overflow:

int copystring(char *dest,char *source,int elements)
{
    int run,omitted=0;
    for(run=0;run&lt;elements-1;run++)//last reserved for'\0'
    {
       dest[run]=source [run];
       if (dest[run]=='\0')
       { 
           break;
           //doesn't increment, so a below will be '\0'
       }
    }
    //now see if characters missed out, starting from first non-copied character 
    char a=source[run];
    while (a!='\0')
    {
       run++;//move on to next char in source
       omitted++;// missed out one more char
       a=source[run];
    }
    dest[elements-1]='\0';//could add an if condition if omitted is 0 
    return omitted;///tells parent function how many letters weren't copied
}


It may be worth my while adding a macro defining maximum amount of omitted chars to check for, and if exceeded to return -1. 

Advantages: terminates in null charcter like strcpy while avoiding overflow like strncpy; returns the amount of characters, if any, that were omitted, so saves writing bit of code for handling this if needed.
Just a few comments.


The standard type for specifying something like the maximum length of a string is size_t. You should probably use that instead of int.
traversing the remainder of the string on the off chance that somebody might want to know how much was skipped seems like poor design. Unless you know you're going to use that (frequently), I'd advise against it. If somebody wants that information, strlen(s) - size is pretty trivial to type, so it's not like you're saving them something terribly arduous.
I think most people accustomed to C would probably use pointer notation throughout.

char *copystring(char *restrict dest, char const *restrict source, size_t elements) {
    char *d;
    for (d = dest; d + 1 &lt; dest + elements; d++, source++)
        *d = *source;
    *d = '\0';
    return d;
}

This returns a pointer to the end of the new string, which frequently is quite useful. For example, if you're building up a string with data filled in at appropriate points, it's often useful to limit the size of each field you insert to a specific maximum, then get a pointer to where you're going to add the next item (though, in fairness, something like snprintf is often more convenient still).