-rw-r--r-- | noncore/apps/opie-reader/Bkmks.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/noncore/apps/opie-reader/Bkmks.cpp b/noncore/apps/opie-reader/Bkmks.cpp index 00141a3..45aa045 100644 --- a/noncore/apps/opie-reader/Bkmks.cpp +++ b/noncore/apps/opie-reader/Bkmks.cpp | |||
@@ -298,96 +298,97 @@ CList<Bkmk>* BkmkFile::readall00(Bkmk* (*readfn)(BkmkFile*, FILE*)) | |||
298 | delete b; | 298 | delete b; |
299 | } | 299 | } |
300 | return bl; | 300 | return bl; |
301 | } | 301 | } |
302 | 302 | ||
303 | Bkmk* BkmkFile::read03(BkmkFile* /*_this*/, FILE* f) | 303 | Bkmk* BkmkFile::read03(BkmkFile* /*_this*/, FILE* f) |
304 | { | 304 | { |
305 | Bkmk* b = NULL; | 305 | Bkmk* b = NULL; |
306 | if (f != NULL) | 306 | if (f != NULL) |
307 | { | 307 | { |
308 | unsigned short ln; | 308 | unsigned short ln; |
309 | if (fread(&ln,sizeof(ln),1,f) == 1) | 309 | if (fread(&ln,sizeof(ln),1,f) == 1) |
310 | { | 310 | { |
311 | tchar* name = new tchar[ln+1]; | 311 | tchar* name = new tchar[ln+1]; |
312 | fread(name,sizeof(tchar),ln,f); | 312 | fread(name,sizeof(tchar),ln,f); |
313 | name[ln] = 0; | 313 | name[ln] = 0; |
314 | 314 | ||
315 | ln = 0; | 315 | ln = 0; |
316 | tchar* anno = new tchar[ln+1]; | 316 | tchar* anno = new tchar[ln+1]; |
317 | anno[ln] = 0; | 317 | anno[ln] = 0; |
318 | 318 | ||
319 | unsigned int pos; | 319 | unsigned int pos; |
320 | fread(&pos,sizeof(pos),1,f); | 320 | fread(&pos,sizeof(pos),1,f); |
321 | b = new Bkmk(name,anno,pos); | 321 | b = new Bkmk(name,anno,pos); |
322 | delete [] anno; | 322 | delete [] anno; |
323 | } | 323 | } |
324 | } | 324 | } |
325 | return b; | 325 | return b; |
326 | } | 326 | } |
327 | 327 | ||
328 | Bkmk* BkmkFile::read05(BkmkFile* /*_this*/, FILE* f) | 328 | Bkmk* BkmkFile::read05(BkmkFile* /*_this*/, FILE* f) |
329 | { | 329 | { |
330 | Bkmk* b = NULL; | 330 | Bkmk* b = NULL; |
331 | if (f != NULL) | 331 | if (f != NULL) |
332 | { | 332 | { |
333 | unsigned short ln; | 333 | unsigned short ln; |
334 | if (fread(&ln,sizeof(ln),1,f) == 1) | 334 | if (fread(&ln,sizeof(ln),1,f) == 1) |
335 | { | 335 | { |
336 | tchar* nm = new tchar[ln+1]; | 336 | tchar* nm = new tchar[ln+1]; |
337 | fread(nm,sizeof(tchar),ln,f); | 337 | fread(nm,sizeof(tchar),ln,f); |
338 | nm[ln] = 0; | 338 | nm[ln] = 0; |
339 | fread(&ln,sizeof(ln),1,f); | 339 | fread(&ln,sizeof(ln),1,f); |
340 | tchar* anno = new tchar[ln+1]; | 340 | tchar* anno = new tchar[ln+1]; |
341 | if (ln > 0) fread(anno,sizeof(tchar),ln,f); | 341 | if (ln > 0) fread(anno,sizeof(tchar),ln,f); |
342 | anno[ln] = 0; | 342 | anno[ln] = 0; |
343 | unsigned int pos; | 343 | unsigned int pos; |
344 | fread(&pos,sizeof(pos),1,f); | 344 | fread(&pos,sizeof(pos),1,f); |
345 | b = new Bkmk(nm,anno,pos); | 345 | b = new Bkmk(nm,anno,pos); |
346 | delete [] anno; | ||
346 | } | 347 | } |
347 | } | 348 | } |
348 | return b; | 349 | return b; |
349 | } | 350 | } |
350 | 351 | ||
351 | Bkmk* BkmkFile::read06(BkmkFile* /*_this*/, FILE* f) | 352 | Bkmk* BkmkFile::read06(BkmkFile* /*_this*/, FILE* f) |
352 | { | 353 | { |
353 | Bkmk* b = NULL; | 354 | Bkmk* b = NULL; |
354 | if (f != NULL) | 355 | if (f != NULL) |
355 | { | 356 | { |
356 | unsigned short ln; | 357 | unsigned short ln; |
357 | if (fread(&ln,sizeof(ln),1,f) == 1) | 358 | if (fread(&ln,sizeof(ln),1,f) == 1) |
358 | { | 359 | { |
359 | b = new Bkmk; | 360 | b = new Bkmk; |
360 | b->m_namelen = ln; | 361 | b->m_namelen = ln; |
361 | b->m_name = new unsigned char[b->m_namelen]; | 362 | b->m_name = new unsigned char[b->m_namelen]; |
362 | fread(b->m_name,1,b->m_namelen,f); | 363 | fread(b->m_name,1,b->m_namelen,f); |
363 | 364 | ||
364 | fread(&(b->m_annolen),sizeof(b->m_annolen),1,f); | 365 | fread(&(b->m_annolen),sizeof(b->m_annolen),1,f); |
365 | if (b->m_annolen > 0) | 366 | if (b->m_annolen > 0) |
366 | { | 367 | { |
367 | b->m_anno = new unsigned char[b->m_annolen]; | 368 | b->m_anno = new unsigned char[b->m_annolen]; |
368 | fread(b->m_anno,1,b->m_annolen,f); | 369 | fread(b->m_anno,1,b->m_annolen,f); |
369 | } | 370 | } |
370 | fread(&(b->m_position),sizeof(b->m_position),1,f); | 371 | fread(&(b->m_position),sizeof(b->m_position),1,f); |
371 | b->m_position2 = b->m_position+b->m_namelen-1; | 372 | b->m_position2 = b->m_position+b->m_namelen-1; |
372 | b->m_red = b->m_green = b->m_blue = 127; | 373 | b->m_red = b->m_green = b->m_blue = 127; |
373 | b->m_level = 0; | 374 | b->m_level = 0; |
374 | } | 375 | } |
375 | } | 376 | } |
376 | return b; | 377 | return b; |
377 | } | 378 | } |
378 | 379 | ||
379 | Bkmk* BkmkFile::read07(BkmkFile* _this, FILE* f) | 380 | Bkmk* BkmkFile::read07(BkmkFile* _this, FILE* f) |
380 | { | 381 | { |
381 | Bkmk* b = NULL; | 382 | Bkmk* b = NULL; |
382 | if (f != NULL) | 383 | if (f != NULL) |
383 | { | 384 | { |
384 | unsigned short ln; | 385 | unsigned short ln; |
385 | if (fread(&ln,sizeof(ln),1,f) == 1) | 386 | if (fread(&ln,sizeof(ln),1,f) == 1) |
386 | { | 387 | { |
387 | b = new Bkmk; | 388 | b = new Bkmk; |
388 | b->m_namelen = ln; | 389 | b->m_namelen = ln; |
389 | b->m_name = new unsigned char[b->m_namelen]; | 390 | b->m_name = new unsigned char[b->m_namelen]; |
390 | fread(b->m_name,1,b->m_namelen,f); | 391 | fread(b->m_name,1,b->m_namelen,f); |
391 | 392 | ||
392 | fread(&(b->m_annolen),sizeof(b->m_annolen),1,f); | 393 | fread(&(b->m_annolen),sizeof(b->m_annolen),1,f); |
393 | if (b->m_annolen > 0) | 394 | if (b->m_annolen > 0) |