Skip to content

Commit 3633344

Browse files
committed
silence compiler warning by casting strlen result to int
1 parent 8e12bc2 commit 3633344

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

SimpleString.cpp

+2-4
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ SimpleString SimpleString::operator= (const SimpleString& other)
3232
{
3333
delete buffer;
3434
buffer = new char [other.size() + 1];
35-
strcpy(buffer, other.buffer);
35+
strcpy(buffer, other.buffer);
3636
return *this;
3737
}
3838

@@ -44,7 +44,7 @@ char *SimpleString::asCharString () const
4444

4545
int SimpleString::size() const
4646
{
47-
return strlen (buffer);
47+
return static_cast<int>(strlen (buffer));
4848
}
4949

5050
SimpleString::~SimpleString ()
@@ -91,5 +91,3 @@ SimpleString StringFrom (const SimpleString& value)
9191
{
9292
return SimpleString(value);
9393
}
94-
95-

0 commit comments

Comments
 (0)