Changeset 3422 for trunk


Ignore:
Timestamp:
Jun 14, 2007, 1:06:49 AM (18 years ago)
Author:
bird
Message:

Open files in binary mode.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/essentials/sys-apps/portage/src/tbz2tool.c

    r3418 r3422  
    9999               
    100100                /* open datafile for reading */
    101                 if ((datafile=fopen(argv[2],"r"))==NULL) {
     101                if ((datafile=fopen(argv[2],"rb"))==NULL) {
    102102                        free(mybuf);
    103103                        free(mystat);
     
    107107               
    108108                /* open dbfile for reading */
    109                 if ((dbfile=fopen(argv[3],"r"))==NULL) {
     109                if ((dbfile=fopen(argv[3],"rb"))==NULL) {
    110110                        fclose(datafile);
    111111                        free(mybuf);
     
    116116       
    117117                /* open outfile for writing */
    118                 if ((outfile=fopen(argv[4],"a"))==NULL) {
     118                if ((outfile=fopen(argv[4],"ab"))==NULL) {
    119119                        fclose(dbfile);
    120120                        fclose(datafile);
     
    158158       
    159159                /* open infile for reading */
    160                 if ((infile=fopen(argv[2],"r"))==NULL) {
     160                if ((infile=fopen(argv[2],"rb"))==NULL) {
    161161                        free(mybuf);
    162162                        free(mystat);
     
    184184               
    185185                /* open datafile for writing */
    186                 if ((datafile=fopen(argv[3],"a"))==NULL) {
     186                if ((datafile=fopen(argv[3],"ab"))==NULL) {
    187187                        fclose(infile);
    188188                        free(mybuf);
     
    193193       
    194194                /* open dbfile for writing */
    195                 if ((dbfile=fopen(argv[4],"a"))==NULL) {
     195                if ((dbfile=fopen(argv[4],"ab"))==NULL) {
    196196                        fclose(datafile);
    197197                        fclose(infile);
Note: See TracChangeset for help on using the changeset viewer.