Changeset 2762 in webkit for trunk/JavaScriptCore/kjs/ustring.cpp


Ignore:
Timestamp:
Nov 19, 2002, 2:25:11 PM (23 years ago)
Author:
darin
Message:
  • fixed memory trasher
  • kjs/ustring.cpp: (UString::from): Fix "end of buffer" computation.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/ustring.cpp

    r2754 r2762  
    251251{
    252252  UChar buf[20];
    253   UChar *p = buf + sizeof(buf);
     253  UChar *end = buf + 20;
     254  UChar *p = end;
    254255 
    255256  if (u == 0) {
     
    262263  }
    263264 
    264   return UString(p, buf + sizeof(buf) - p);
     265  return UString(p, end - p);
    265266}
    266267
     
    268269{
    269270  UChar buf[20];
    270   UChar *p = buf + sizeof(buf);
     271  UChar *end = buf + 20;
     272  UChar *p = end;
    271273 
    272274  if (l == 0) {
     
    291293  }
    292294 
    293   return UString(p, buf + sizeof(buf) - p);
     295  return UString(p, end - p);
    294296}
    295297
Note: See TracChangeset for help on using the changeset viewer.