- Timestamp:
- Mar 9, 2006, 7:55:44 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/mesh/reader.cc
r303 r307 26 26 #endif 27 27 28 delete header;28 delete [] header; 29 29 } 30 30 … … 57 57 // parse object name 58 58 // 59 void readString(const char* buf, string& name)59 void readString(const char* buf, string& str) 60 60 { 61 61 char* ptr = (char*)buf; 62 62 int len; 63 63 64 // copy length of name64 // read length of string 65 65 66 66 ByteOrder<int>::OrderCopy((int*)ptr, &len); … … 68 68 ptr += sizeof(int); 69 69 70 // copy name aschars70 // read chars 71 71 72 72 char* cstr = new char[len]; ; 73 73 ByteOrder<char>::OrderCopyArray(ptr, cstr, len); 74 74 filterTrailingBlanks(cstr, len); 75 name= cstr;75 str = cstr; 76 76 77 delete cstr;77 delete [] cstr; 78 78 } 79 79 … … 82 82 char *ptr = buf; 83 83 84 // copy length of name84 // write length of string 85 85 86 86 ByteOrder<int>::OrderCopy(&len, (int*)ptr); 87 87 ptr += sizeof(int); 88 88 89 // copychars89 // write chars 90 90 ByteOrder<char>::OrderCopyArray(str, ptr, len); 91 91 }
Note: See TracChangeset
for help on using the changeset viewer.