hopefully the last adjustment to the functions
This commit is contained in:
parent
d17314e797
commit
faab3f7fee
22
src/rtext.c
22
src/rtext.c
|
|
@ -1344,15 +1344,17 @@ Rectangle GetGlyphAtlasRec(Font font, int codepoint)
|
|||
// Get text length in bytes, check for \0 character
|
||||
unsigned int TextLength(const char *text)
|
||||
{
|
||||
if (!text)
|
||||
return 0;
|
||||
unsigned int length = 0;
|
||||
|
||||
// use strlen since it uses vector operations
|
||||
unsigned int length = strlen(text);
|
||||
if (!text)
|
||||
return length;
|
||||
|
||||
length = strlen(text);
|
||||
|
||||
return length;
|
||||
}
|
||||
|
||||
|
||||
// Formatting of text with variables to 'embed'
|
||||
const char *TextFormat(const char *text, ...)
|
||||
{
|
||||
|
|
@ -1411,15 +1413,18 @@ int TextToInteger(const char *text)
|
|||
// Copy one string to another, returns bytes copied
|
||||
int TextCopy(char *dst, const char *src)
|
||||
{
|
||||
int bytes = 0;
|
||||
|
||||
if (!dst || !src)
|
||||
return 0;
|
||||
return bytes;
|
||||
|
||||
// use strcpy since it uses vector operations
|
||||
unsigned int length = *strcpy(dst, src);
|
||||
strcpy(dst, src);
|
||||
bytes = strlen(dst);
|
||||
|
||||
return length;
|
||||
return bytes;
|
||||
}
|
||||
|
||||
|
||||
// Check if two text string are equal
|
||||
// REQUIRES: strcmp()
|
||||
bool TextIsEqual(const char *text1, const char *text2)
|
||||
|
|
@ -1454,7 +1459,6 @@ const char *TextSubtext(const char *text, int position, int length)
|
|||
memcpy(buffer, text+position, length);
|
||||
|
||||
*(buffer + length) = '\0';
|
||||
*(buffer + length + 1) = 0;
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user