[svn r663] Added verification to GMYTH_FILE_READ_NEXT_PROG_CHAIN return values.
1.1 --- a/gmyth/samples/gmyth_cat.c Tue May 15 21:54:05 2007 +0100
1.2 +++ b/gmyth/samples/gmyth_cat.c Tue May 15 22:14:04 2007 +0100
1.3 @@ -158,6 +158,8 @@
1.4 GMythFile *gmyth_file = NULL;
1.5 GArray *array = NULL;
1.6
1.7 + gint file_transf_ret;
1.8 +
1.9 g_return_val_if_fail (options != NULL, FALSE);
1.10 g_return_val_if_fail (options->b_info != NULL, FALSE);
1.11 g_return_val_if_fail (options->channel != NULL, FALSE);
1.12 @@ -190,9 +192,10 @@
1.13
1.14 array = g_array_new (FALSE, TRUE, sizeof(gchar));
1.15
1.16 - while( gmyth_file_transfer_read
1.17 + while( ( ( file_transf_ret = gmyth_file_transfer_read
1.18 (GMYTH_FILE_TRANSFER(gmyth_file),
1.19 - (GByteArray*)array, 64000, TRUE) == GMYTH_FILE_READ_OK )
1.20 + (GByteArray*)array, 64000, TRUE) ) == GMYTH_FILE_READ_OK ) ||
1.21 + file_transf_ret == GMYTH_FILE_READ_NEXT_PROG_CHAIN )
1.22 {
1.23
1.24 fwrite (array->data, array->len, 1, stdout);