Commit ff56afa0 authored by darin's avatar darin

- fixed memory trasher

        * kjs/ustring.cpp: (UString::from): Fix "end of buffer" computation.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2762 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 880105d6
2002-11-19 Darin Adler <darin@apple.com>
- fixed memory trasher
* kjs/ustring.cpp: (UString::from): Fix "end of buffer" computation.
2002-11-19 Darin Adler <darin@apple.com>
- a first step towards atomic identifiers in JavaScript
......
2002-11-19 Darin Adler <darin@apple.com>
- fixed memory trasher
* kjs/ustring.cpp: (UString::from): Fix "end of buffer" computation.
2002-11-19 Darin Adler <darin@apple.com>
- a first step towards atomic identifiers in JavaScript
......
2002-11-19 Darin Adler <darin@apple.com>
- fixed memory trasher
* kjs/ustring.cpp: (UString::from): Fix "end of buffer" computation.
2002-11-19 Darin Adler <darin@apple.com>
- a first step towards atomic identifiers in JavaScript
......
......@@ -250,7 +250,8 @@ UString UString::from(int i)
UString UString::from(unsigned int u)
{
UChar buf[20];
UChar *p = buf + sizeof(buf);
UChar *end = buf + 20;
UChar *p = end;
if (u == 0) {
*--p = '0';
......@@ -261,13 +262,14 @@ UString UString::from(unsigned int u)
}
}
return UString(p, buf + sizeof(buf) - p);
return UString(p, end - p);
}
UString UString::from(long l)
{
UChar buf[20];
UChar *p = buf + sizeof(buf);
UChar *end = buf + 20;
UChar *p = end;
if (l == 0) {
*--p = '0';
......@@ -290,7 +292,7 @@ UString UString::from(long l)
}
}
return UString(p, buf + sizeof(buf) - p);
return UString(p, end - p);
}
UString UString::from(double d)
......
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