Skip to content

Commit

Permalink
[FreetuxTV] Correction crash.
Browse files Browse the repository at this point in the history
  • Loading branch information
eric.beuque committed Apr 11, 2010
1 parent 3cbac2d commit fc10cc3
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 20 deletions.
4 changes: 2 additions & 2 deletions src/freetuxtv-tv-channel-infos.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,8 @@ freetuxtv_tv_channel_infos_get_logo_filename(FreetuxTVTvChannelInfos* tv_channel
void
freetuxtv_tv_channel_infos_add_label(FreetuxTVTvChannelInfos* tv_channel_infos, gchar *label)
{
g_return_val_if_fail(tv_channel_infos != NULL, NULL);
g_return_val_if_fail(FREETUXTV_IS_TV_CHANNEL_INFOS(tv_channel_infos), NULL);
g_return_if_fail(tv_channel_infos != NULL);
g_return_if_fail(FREETUXTV_IS_TV_CHANNEL_INFOS(tv_channel_infos));

FreetuxTVTvChannelInfosPrivate* priv;
gchar* text;
Expand Down
37 changes: 19 additions & 18 deletions src/lib-m3uparser.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,30 +206,31 @@ libm3uparser_get_extdata (char argc, char **argv, char *ext_name,
/* Get ext name */
begin = argv[i];
end = strchr(argv[i], ':');
cars = end - begin;
optname = (char *) malloc ((cars + 1) * sizeof(char));
strncpy(optname, begin, cars);
optname[cars] = '\0';
if(end){
cars = end - begin;
optname = (char *) malloc ((cars + 1) * sizeof(char));
strncpy(optname, begin, cars);
optname[cars] = '\0';

/* Compare the name found with the given ext_name */
if(strcmp(optname, ext_name) == 0){
nb++;
/* Compare the name found with the given ext_name */
if(strcmp(optname, ext_name) == 0){
nb++;

*ext_data = (char **) realloc(*ext_data, nb * sizeof(char*));
*ext_data = (char **) realloc(*ext_data, nb * sizeof(char*));

// Get current ext data
begin = end + 1;
end = argv[i] + strlen(argv[i]);
cars = end - begin;
// Get current ext data
begin = end + 1;
end = argv[i] + strlen(argv[i]);
cars = end - begin;

(*ext_data)[nb-1] = (char *) malloc ((cars + 1) * sizeof(char));
strncpy((*ext_data)[nb-1], begin, cars);
(*ext_data)[nb-1][cars] = '\0';

res = LIBM3UPARSER_OK;
(*ext_data)[nb-1] = (char *) malloc ((cars + 1) * sizeof(char));
strncpy((*ext_data)[nb-1], begin, cars);
(*ext_data)[nb-1][cars] = '\0';

res = LIBM3UPARSER_OK;
}
free (optname);
}
free (optname);
}
*ext_count = nb;
}
Expand Down

0 comments on commit fc10cc3

Please sign in to comment.