Commit 7e9f61e3 authored by Claes Sjofors's avatar Claes Sjofors

cdh_Strcpy added for copying into the same buffer

parent 910f41b7
......@@ -2567,6 +2567,19 @@ cdh_NoCaseStrncmp (
(isalpha(*t) ? ((*t) & ~(1<<5)) : *t);
}
//! Copy string char by char to allow overlapping source and target buffers
char *cdh_Strcpy( char *dest, const char *src)
{
const char *s;
char *t;
for ( s = src, t = dest; *s; s++,t++)
*t = *s;
*t = 0;
return dest;
}
//! Copy string, and cut of if the string is to long with ending '...'
/*!
For example the string '0123456789' will return the string '0123...' when
......
......@@ -1015,6 +1015,8 @@ cdh_NoCaseStrncmp (
size_t n
);
char *cdh_Strcpy( char *dest, const char *src);
int
cdh_StrncpyCutOff(
char *s,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment