~ubuntu-branches/ubuntu/maverick/clamav/maverick-backports

« back to all changes in this revision

Viewing changes to libclamav/tnef.c

  • Committer: Bazaar Package Importer
  • Author(s): Stephen Gran, Stephen Gran, Michael Tautschnig
  • Date: 2010-04-26 21:41:18 UTC
  • mfrom: (2.1.6 squeeze)
  • Revision ID: james.westby@ubuntu.com-20100426214118-i6lo606wnh7ywfj6
Tags: 0.96+dfsg-4
[ Stephen Gran ]
* Fixed typo in clamav-milter's postinst

[ Michael Tautschnig ]
* Fixed typo in clamav-freshclam's postinst (closes: #579271)
* Debconf translation updates
  - Portuguese (closes: #579068)

Show diffs side-by-side

added added

removed removed

Lines of Context:
182
182
                                        char buffer[BUFSIZ];
183
183
 
184
184
                                        if(filename)
185
 
#ifdef  O_BINARY
186
185
                                                fout = open(filename, O_WRONLY|O_CREAT|O_EXCL|O_TRUNC|O_BINARY, 0600);
187
 
#else
188
 
                                                fout = open(filename, O_WRONLY|O_CREAT|O_EXCL|O_TRUNC, 0600);
189
 
#endif
190
186
 
191
187
                                        if(fout >= 0) {
192
188
                                                int count;
341
337
                                if(*fbref == NULL)
342
338
                                        return -1;
343
339
                        }
344
 
                        for(todo = length; todo; todo--) {
345
 
#if WORDS_BIGENDIAN == 1
346
 
                                int c;
347
 
                                unsigned char c2;
348
 
 
349
 
                                if((c = fgetc(fp)) == EOF)
350
 
                                        break;
351
 
                                c2 = (unsigned char)c;
352
 
                                fileblobAddData(*fbref, (const unsigned char *)&c2, 1);
353
 
#else
354
 
                                int c;
355
 
 
356
 
                                if((c = fgetc(fp)) == EOF)
357
 
                                        break;
358
 
                                fileblobAddData(*fbref, (const unsigned char *)&c, 1);
359
 
#endif
 
340
                        todo = length;
 
341
                        while(todo && !feof(fp) && !ferror(fp)) {
 
342
                            unsigned char buf[BUFSIZ];
 
343
                            uint32_t got = fread(buf, 1, MIN(sizeof(buf), todo), fp);
 
344
 
 
345
                            fileblobAddData(*fbref, buf, got);
 
346
                            todo -= got;
360
347
                        }
361
348
                        break;
362
349
                default: