synced CString.h

This commit is contained in:
Borja Ferrer 2006-02-05 19:16:16 +00:00
parent b5b42c675d
commit e929dc55bd
3 changed files with 15 additions and 9 deletions

View File

@ -107,8 +107,10 @@ public:
{
clear();
} else {
Grow(strlen(d) + 1, false);
strcpy(v, d);
size_t len = strlen(d);
Grow(len + 1, false);
memcpy(v, d, len);
v[len] = '\0';
}
}
@ -118,7 +120,7 @@ public:
v[0] = '\0';
}
int compare (const char *d)
int compare (const char *d) const
{
if (!v)
return strcmp("", d);

View File

@ -107,8 +107,10 @@ public:
{
clear();
} else {
Grow(strlen(d) + 1, false);
strcpy(v, d);
size_t len = strlen(d);
Grow(len + 1, false);
memcpy(v, d, len);
v[len] = '\0';
}
}
@ -118,7 +120,7 @@ public:
v[0] = '\0';
}
int compare (const char *d)
int compare (const char *d) const
{
if (!v)
return strcmp("", d);

View File

@ -107,8 +107,10 @@ public:
{
clear();
} else {
Grow(strlen(d) + 1, false);
strcpy(v, d);
size_t len = strlen(d);
Grow(len + 1, false);
memcpy(v, d, len);
v[len] = '\0';
}
}
@ -118,7 +120,7 @@ public:
v[0] = '\0';
}
int compare (const char *d)
int compare (const char *d) const
{
if (!v)
return strcmp("", d);