# HG changeset patch # User rosfran # Date 1179263644 -3600 # Node ID 0469baf4217cc36b1ac7e329ce2c983faa3a27b0 # Parent 49f79548b1cc5fdf61c78d7018b3516585458e14 [svn r663] Added verification to GMYTH_FILE_READ_NEXT_PROG_CHAIN return values. diff -r 49f79548b1cc -r 0469baf4217c gmyth/samples/gmyth_cat.c --- a/gmyth/samples/gmyth_cat.c Tue May 15 21:54:05 2007 +0100 +++ b/gmyth/samples/gmyth_cat.c Tue May 15 22:14:04 2007 +0100 @@ -158,6 +158,8 @@ GMythFile *gmyth_file = NULL; GArray *array = NULL; + gint file_transf_ret; + g_return_val_if_fail (options != NULL, FALSE); g_return_val_if_fail (options->b_info != NULL, FALSE); g_return_val_if_fail (options->channel != NULL, FALSE); @@ -190,9 +192,10 @@ array = g_array_new (FALSE, TRUE, sizeof(gchar)); - while( gmyth_file_transfer_read + while( ( ( file_transf_ret = gmyth_file_transfer_read (GMYTH_FILE_TRANSFER(gmyth_file), - (GByteArray*)array, 64000, TRUE) == GMYTH_FILE_READ_OK ) + (GByteArray*)array, 64000, TRUE) ) == GMYTH_FILE_READ_OK ) || + file_transf_ret == GMYTH_FILE_READ_NEXT_PROG_CHAIN ) { fwrite (array->data, array->len, 1, stdout);