diff options
| author | Ray <[email protected]> | 2020-01-26 18:38:46 +0100 |
|---|---|---|
| committer | Ray <[email protected]> | 2020-01-26 18:38:46 +0100 |
| commit | 5ec87c4c6fd0b9aa40cda7bab527fa9ea1ee461f (patch) | |
| tree | be689e9b3e40e86c2eee770c23da61f855b84722 /src/text.c | |
| parent | 05443cd0c88f8af2e861e37d7cba2d9db7c3eadc (diff) | |
| download | raylib-5ec87c4c6fd0b9aa40cda7bab527fa9ea1ee461f.tar.gz raylib-5ec87c4c6fd0b9aa40cda7bab527fa9ea1ee461f.zip | |
ADDED: TextCopy() #1083
Diffstat (limited to 'src/text.c')
| -rw-r--r-- | src/text.c | 24 |
1 files changed, 24 insertions, 0 deletions
@@ -1105,8 +1105,32 @@ int GetGlyphIndex(Font font, int codepoint) #endif } +//---------------------------------------------------------------------------------- // Text strings management functions //---------------------------------------------------------------------------------- + +// Copy one string to another, returns bytes copied +int TextCopy(char *dst, const char *src) +{ + int bytes = 0; + + if (dst != NULL) + { + while (*src != '\0') + { + *dst = *src; + dst++; + src++; + + bytes++; + } + + *dst = '\0'; + } + + return bytes; +} + // Check if two text string are equal // REQUIRES: strcmp() bool TextIsEqual(const char *text1, const char *text2) |
