Changeset 10971 for branches


Ignore:
Timestamp:
Jul 7, 2010, 10:50:22 PM (12 years ago)
Author:
charles
Message:

(2.0x T) #3404 "crash when creating a .torrent containing empty content" -- fixed

Location:
branches/2.0x
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/2.0x/gtk/makemeta-ui.c

    r10340 r10971  
    6868    GtkDialog * d = GTK_DIALOG( ui->progress_dialog );
    6969    GtkProgressBar * p = GTK_PROGRESS_BAR( ui->progress_bar );
    70     const double fraction = (double)b->pieceIndex / b->pieceCount;
     70    const double fraction = b->pieceCount ? ((double)b->pieceIndex / b->pieceCount) : 0;
    7171        char * base = g_path_get_basename( b->top );
    7272
  • branches/2.0x/libtransmission/makemeta.c

    r10634 r10971  
    390390    tr_bencInitDict( &top, 6 );
    391391
     392    if( !builder->fileCount || !builder->totalSize ||
     393        !builder->pieceSize || !builder->pieceCount )
     394    {
     395        builder->errfile[0] = '\0';
     396        builder->my_errno = ENOENT;
     397        builder->result = TR_MAKEMETA_IO_READ;
     398        builder->isDone = TRUE;
     399    }
     400
    392401    if( !builder->result && builder->trackerCount )
    393402    {
  • branches/2.0x/libtransmission/makemeta.h

    r9868 r10971  
    3030    TR_MAKEMETA_URL,
    3131    TR_MAKEMETA_CANCELLED,
    32     TR_MAKEMETA_IO_READ,   /* see builder.errfile, builder.errno */
    33     TR_MAKEMETA_IO_WRITE   /* see builder.errfile, builder.errno */
     32    TR_MAKEMETA_IO_READ,   /* see builder.errfile, builder.my_errno */
     33    TR_MAKEMETA_IO_WRITE   /* see builder.errfile, builder.my_errno */
    3434}
    3535tr_metainfo_builder_err;
Note: See TracChangeset for help on using the changeset viewer.