| 91 | |
| 92 | |
| 93 | char* copy_terminate(char* dest, const char* src, size_t bufsize) |
| 94 | { |
| 95 | /************************************** |
| 96 | * |
| 97 | * c o p y _ t e r m i n a t e |
| 98 | * |
| 99 | ************************************** |
| 100 | * |
| 101 | * Functional description |
| 102 | * Do the same as strncpy but ensure the null terminator is written. |
| 103 | * |
| 104 | **************************************/ |
| 105 | if (!bufsize) // Was it a joke? |
| 106 | return dest; |
| 107 | |
| 108 | --bufsize; |
| 109 | strncpy(dest, src, bufsize); |
| 110 | dest[bufsize] = 0; |
| 111 | return dest; |
| 112 | } |
| 113 | |
| 114 | |
| 115 | char* exact_name(char* const name) |
no outgoing calls
no test coverage detected