diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/dxr3/video_out_dxr3.c | 2 | ||||
-rw-r--r-- | src/input/http_helper.h | 7 | ||||
-rw-r--r-- | src/input/input_cdda.c | 4 | ||||
-rw-r--r-- | src/input/input_dvb.c | 14 | ||||
-rw-r--r-- | src/input/input_dvd.c | 4 | ||||
-rw-r--r-- | src/input/input_file.c | 9 | ||||
-rw-r--r-- | src/input/input_http.c | 2 | ||||
-rw-r--r-- | src/input/input_pvr.c | 14 | ||||
-rw-r--r-- | src/input/input_rtsp.c | 2 | ||||
-rw-r--r-- | src/input/input_smb.c | 16 | ||||
-rw-r--r-- | src/input/input_vcd.c | 5 | ||||
-rw-r--r-- | src/input/librtsp/rtsp.c | 14 | ||||
-rw-r--r-- | src/libreal/real_common.c | 4 | ||||
-rw-r--r-- | src/post/mosaico/mosaico.c | 2 | ||||
-rw-r--r-- | src/post/planar/pp.c | 19 | ||||
-rw-r--r-- | src/vdr/input_vdr.c | 6 | ||||
-rw-r--r-- | src/video_out/video_out_opengl.c | 2 | ||||
-rw-r--r-- | src/xine-engine/configfile.c | 2 | ||||
-rw-r--r-- | src/xine-engine/load_plugins.c | 10 | ||||
-rw-r--r-- | src/xine-engine/osd.c | 4 | ||||
-rw-r--r-- | src/xine-utils/xmlparser.c | 9 |
21 files changed, 72 insertions, 79 deletions
diff --git a/src/dxr3/video_out_dxr3.c b/src/dxr3/video_out_dxr3.c index a5d75cc69..1fd1028a8 100644 --- a/src/dxr3/video_out_dxr3.c +++ b/src/dxr3/video_out_dxr3.c @@ -1336,7 +1336,7 @@ static int dxr3_overlay_read_state(dxr3_overlay_t *this) * (used by .overlay/res file) */ setlocale(LC_NUMERIC, "C"); - asprintf(&fname, "%s/.overlay/res_%dx%dx%d", getenv("HOME"), + fname = _x_asprintf("%s/.overlay/res_%dx%dx%d", getenv("HOME"), this->screen_xres, this->screen_yres, this->screen_depth); llprintf(LOG_OVR, "attempting to open %s\n", fname); if (!(fp = fopen(fname, "r"))) { diff --git a/src/input/http_helper.h b/src/input/http_helper.h index e53ccbe88..999633113 100644 --- a/src/input/http_helper.h +++ b/src/input/http_helper.h @@ -24,6 +24,7 @@ #define HTTP_HELPER_H #include <xine/attributes.h> +#include <xine/xine_internal.h> /* * user agent finder, using modified protcol names @@ -60,7 +61,7 @@ int _x_parse_url (char *url, char **proto, char** host, int *port, static inline XINE_MALLOC char *_x_canonicalise_url (const char *base, const char *url) { size_t base_length; - char *cut, *ret; + char *cut; if ((cut = strstr (url, "://"))) return strdup (url); @@ -77,8 +78,8 @@ static inline XINE_MALLOC char *_x_canonicalise_url (const char *base, const cha ++cut; } base_length = cut ? (size_t)(cut - base) : strlen (base); - asprintf (&ret, "%.*s%s", (int)base_length, base, url); - return ret; + + return _x_asprintf ("%.*s%s", (int)base_length, base, url); } #endif /* HTTP_HELPER_H */ diff --git a/src/input/input_cdda.c b/src/input/input_cdda.c index 61528fea5..824b97fbb 100644 --- a/src/input/input_cdda.c +++ b/src/input/input_cdda.c @@ -1485,7 +1485,7 @@ static void _cdda_parse_cddb_info (cdda_input_plugin_t *this, char *buffer, char int nyear; char *y = strstr (buffer, "YEAR:"); if (y && sscanf (y + 5, "%4d", &nyear) == 1) - asprintf (&this->cddb.disc_year, "%d", nyear); + this->cddb.disc_year = _x_asprintf ("%d", nyear); } } } @@ -2510,7 +2510,7 @@ static char ** cdda_class_get_autoplay_list (input_class_t *this_gen, if (num_tracks >= MAX_TRACKS-1) num_tracks = MAX_TRACKS - 2; for ( i = 0; i <= num_tracks; i++ ) - asprintf(&this->autoplaylist[i],"cdda:/%d",i+toc->first_track); + this->autoplaylist[i] = _x_asprintf("cdda:/%d",i+toc->first_track); *num_files = toc->last_track - toc->first_track + 1; diff --git a/src/input/input_dvb.c b/src/input/input_dvb.c index 0fac0290a..cb2c48e2c 100644 --- a/src/input/input_dvb.c +++ b/src/input/input_dvb.c @@ -587,11 +587,11 @@ static tuner_t *XINE_MALLOC tuner_init(xine_t * xine, int adapter) this->xine = xine; this->adapter_num = adapter; - asprintf(&this->demux_device,"/dev/dvb/adapter%i/demux0",this->adapter_num); - asprintf(&this->dvr_device,"/dev/dvb/adapter%i/dvr0",this->adapter_num); - asprintf(&video_device,"/dev/dvb/adapter%i/video0",this->adapter_num); + this->demux_device = _x_asprintf("/dev/dvb/adapter%i/demux0",this->adapter_num); + this->dvr_device = _x_asprintf("/dev/dvb/adapter%i/dvr0",this->adapter_num); + video_device = _x_asprintf("/dev/dvb/adapter%i/video0",this->adapter_num); - asprintf(&frontend_device,"/dev/dvb/adapter%i/frontend0",this->adapter_num); + frontend_device = _x_asprintf("/dev/dvb/adapter%i/frontend0",this->adapter_num); if ((this->fd_frontend = xine_open_cloexec(frontend_device, O_RDWR)) < 0) { xprintf(this->xine, XINE_VERBOSITY_DEBUG, "FRONTEND DEVICE: %s\n", strerror(errno)); tuner_dispose(this); @@ -3224,7 +3224,7 @@ static char **dvb_class_get_autoplay_list(input_class_t * this_gen, ch < num_channels && ch < MAX_AUTOCHANNELS; ++ch, ++apch) { free(class->autoplaylist[apch]); - asprintf(&(class->autoplaylist[apch]), "dvb://%s", channels[ch].name); + class->autoplaylist[apch] = _x_asprintf("dvb://%s", channels[ch].name); _x_assert(class->autoplaylist[apch] != NULL); } @@ -3232,10 +3232,10 @@ static char **dvb_class_get_autoplay_list(input_class_t * this_gen, free(class->autoplaylist[0]); if (default_channel != -1) /* plugin has been used before - channel is valid */ - asprintf (&(class->autoplaylist[0]), "dvb://%s", channels[default_channel].name); + class->autoplaylist[0] = _x_asprintf("dvb://%s", channels[default_channel].name); else /* set a reasonable default - the first channel */ - asprintf (&(class->autoplaylist[0]), "dvb://%s", num_channels ? channels[0].name : "0"); + class->autoplaylist[0] = _x_asprintf("dvb://%s", num_channels ? channels[0].name : "0"); } free_channel_list(channels, num_channels); diff --git a/src/input/input_dvd.c b/src/input/input_dvd.c index 17df441f2..c46481271 100644 --- a/src/input/input_dvd.c +++ b/src/input/input_dvd.c @@ -1381,8 +1381,8 @@ check_solaris_vold_device(dvd_input_class_t *this) (volume_action = getenv("VOLUME_ACTION")) != NULL && strcmp(volume_action, "insert") == 0) { - asprintf(&device, "%s/%s", volume_device, volume_name); - if (stat(device, &stb) != 0 || !S_ISCHR(stb.st_mode)) { + device = _x_asprintf("%s/%s", volume_device, volume_name); + if (!device || stat(device, &stb) != 0 || !S_ISCHR(stb.st_mode)) { free(device); return; } diff --git a/src/input/input_file.c b/src/input/input_file.c index 4c5e3e563..c2ecd3c0b 100644 --- a/src/input/input_file.c +++ b/src/input/input_file.c @@ -711,8 +711,7 @@ static xine_mrl_t **file_class_get_dir (input_class_t *this_gen, else { dir_files[num_dir_files].origin = strdup(current_dir); - asprintf(&(dir_files[num_dir_files].mrl), "%s%s", - current_dir_slashed, pdirent->d_name); + dir_files[num_dir_files].mrl = _x_asprintf("%s%s", current_dir_slashed, pdirent->d_name); dir_files[num_dir_files].link = NULL; dir_files[num_dir_files].type = get_file_type(fullfilename, current_dir, this->xine); dir_files[num_dir_files].size = get_file_size(fullfilename, current_dir); @@ -747,8 +746,7 @@ static xine_mrl_t **file_class_get_dir (input_class_t *this_gen, if(this->show_hidden_files) { hide_files[num_hide_files].origin = strdup(current_dir); - asprintf(&(hide_files[num_hide_files].mrl), "%s%s", - current_dir_slashed, pdirent->d_name); + hide_files[num_hide_files].mrl = _x_asprintf("%s%s", current_dir_slashed, pdirent->d_name); hide_files[num_hide_files].link = NULL; hide_files[num_hide_files].type = get_file_type(fullfilename, current_dir, this->xine); hide_files[num_hide_files].size = get_file_size(fullfilename, current_dir); @@ -779,8 +777,7 @@ static xine_mrl_t **file_class_get_dir (input_class_t *this_gen, else { norm_files[num_norm_files].origin = strdup(current_dir); - asprintf(&(norm_files[num_norm_files].mrl), "%s%s", - current_dir_slashed, pdirent->d_name); + norm_files[num_norm_files].mrl = _x_asprintf("%s%s", current_dir_slashed, pdirent->d_name); norm_files[num_norm_files].link = NULL; norm_files[num_norm_files].type = get_file_type(fullfilename, current_dir, this->xine); norm_files[num_norm_files].size = get_file_size(fullfilename, current_dir); diff --git a/src/input/input_http.c b/src/input/input_http.c index d4a1b4de6..e67c07566 100644 --- a/src/input/input_http.c +++ b/src/input/input_http.c @@ -1013,7 +1013,7 @@ static input_plugin_t *http_class_get_instance (input_class_t *cls_gen, xine_str this = calloc(1, sizeof(http_input_plugin_t)); if (!strncasecmp (mrl, "peercast://pls/", 15)) { - asprintf (&this->mrl, "http://127.0.0.1:7144/stream/%s", mrl+15); + this->mrl = _x_asprintf ("http://127.0.0.1:7144/stream/%s", mrl+15); } else { this->mrl = strdup (mrl); } diff --git a/src/input/input_pvr.c b/src/input/input_pvr.c index 53c104299..5e66bee82 100644 --- a/src/input/input_pvr.c +++ b/src/input/input_pvr.c @@ -510,36 +510,28 @@ static void pvr_adjust_realtime_speed(pvr_input_plugin_t *this, fifo_buffer_t *f #define PVR_FILENAME "%s%08d_%08d.vob" static char *make_temp_name(pvr_input_plugin_t *this, int page) { - char *filename; - - asprintf(&filename, PVR_FILENAME, this->tmp_prefix, this->session, page); - return filename; + return _x_asprintf(PVR_FILENAME, this->tmp_prefix, this->session, page); } #define SAVE_BASE_FILENAME "ch%03d %02d-%02d-%04d %02d:%02d:%02d" static char *make_base_save_name(int channel, time_t tm) { struct tm rec_time; - char *filename; localtime_r(&tm, &rec_time); - asprintf(&filename, SAVE_BASE_FILENAME, + return _x_asprintf(SAVE_BASE_FILENAME, channel, rec_time.tm_mon+1, rec_time.tm_mday, rec_time.tm_year+1900, rec_time.tm_hour, rec_time.tm_min, rec_time.tm_sec); - return filename; } #define SAVE_FILENAME "%s%s_%04d.vob" static char *make_save_name(pvr_input_plugin_t *this, char *base, int page) { - char *filename; - - asprintf(&filename, SAVE_FILENAME, this->save_prefix, base, page); - return filename; + return _x_asprintf(SAVE_FILENAME, this->save_prefix, base, page); } /* diff --git a/src/input/input_rtsp.c b/src/input/input_rtsp.c index e8c1a1ce7..41885698d 100644 --- a/src/input/input_rtsp.c +++ b/src/input/input_rtsp.c @@ -266,7 +266,7 @@ static input_plugin_t *rtsp_class_get_instance (input_class_t *cls_gen, xine_str /* since we handle only real streams yet, we can savely add * an .rm extention to force handling by demux_real. */ - asprintf(&this->public_mrl, "%s.rm", this->mrl); + this->public_mrl = _x_asprintf("%s.rm", this->mrl); this->nbc = nbc_init (stream); diff --git a/src/input/input_smb.c b/src/input/input_smb.c index 6e857259b..b2211e2ae 100644 --- a/src/input/input_smb.c +++ b/src/input/input_smb.c @@ -263,7 +263,7 @@ static xine_mrl_t **smb_class_get_dir (input_class_t *this_gen, dir_files[num_dir_files].link = NULL; dir_files[num_dir_files].type = mrl_file | mrl_file_directory; dir_files[num_dir_files].origin = strdup(current_path); - asprintf(&(dir_files[num_dir_files].mrl), "%s/%s", current_path, pdirent->name); + dir_files[num_dir_files].mrl = _x_asprintf("%s/%s", current_path, pdirent->name); dir_files[num_dir_files].size = pdirent->dirlen; num_dir_files ++; }else if (pdirent->smbc_type == SMBC_SERVER){ @@ -271,14 +271,14 @@ static xine_mrl_t **smb_class_get_dir (input_class_t *this_gen, dir_files[num_dir_files].link = NULL; dir_files[num_dir_files].type = mrl_file | mrl_file_directory; dir_files[num_dir_files].origin = strdup("smb:/"); - asprintf(&(dir_files[num_dir_files].mrl), "%s/%s", "smb:/", ".."); + dir_files[num_dir_files].mrl = strdup("smb://.."); dir_files[num_dir_files].size = pdirent->dirlen; num_dir_files ++; } dir_files[num_dir_files].link = NULL; dir_files[num_dir_files].type = mrl_file | mrl_file_directory; dir_files[num_dir_files].origin = strdup("smb:/"); - asprintf(&(dir_files[num_dir_files].mrl), "%s/%s", "smb:/", pdirent->name); + dir_files[num_dir_files].mrl = _x_asprintf("smb://%s", pdirent->name); dir_files[num_dir_files].size = pdirent->dirlen; num_dir_files ++; } else if (pdirent->smbc_type == SMBC_FILE_SHARE){ @@ -286,7 +286,7 @@ static xine_mrl_t **smb_class_get_dir (input_class_t *this_gen, dir_files[num_dir_files].link = NULL; dir_files[num_dir_files].type = mrl_file | mrl_file_directory; dir_files[num_dir_files].origin = strdup(current_path); - asprintf(&(dir_files[num_dir_files].mrl), "%s/%s", current_path, ".."); + dir_files[num_dir_files].mrl = _x_asprintf("%s/..", current_path); dir_files[num_dir_files].type |= mrl_file_directory; dir_files[num_dir_files].size = pdirent->dirlen; num_dir_files ++; @@ -295,7 +295,7 @@ static xine_mrl_t **smb_class_get_dir (input_class_t *this_gen, dir_files[num_dir_files].link = NULL; dir_files[num_dir_files].type = mrl_file | mrl_file_directory; dir_files[num_dir_files].origin = strdup(current_path); - asprintf(&(dir_files[num_dir_files].mrl), "%s/%s", current_path, pdirent->name); + dir_files[num_dir_files].mrl = _x_asprintf("%s/%s", current_path, pdirent->name); dir_files[num_dir_files].size = pdirent->dirlen; num_dir_files ++; } @@ -303,14 +303,14 @@ static xine_mrl_t **smb_class_get_dir (input_class_t *this_gen, dir_files[num_dir_files].link = NULL; dir_files[num_dir_files].type = mrl_file | mrl_file_directory; dir_files[num_dir_files].origin = strdup(current_path); - asprintf(&(dir_files[num_dir_files].mrl), "%s/%s", current_path, pdirent->name); + dir_files[num_dir_files].mrl = _x_asprintf("%s/%s", current_path, pdirent->name); dir_files[num_dir_files].size = pdirent->dirlen; num_dir_files ++; }else if (pdirent->smbc_type == SMBC_FILE){ norm_files[num_norm_files].link = NULL; norm_files[num_norm_files].type = mrl_file | mrl_file_normal; norm_files[num_norm_files].origin = strdup(current_path); - asprintf(&(norm_files[num_norm_files].mrl), "%s/%s", current_path, pdirent->name); + norm_files[num_norm_files].mrl = _x_asprintf("%s/%s", current_path, pdirent->name); norm_files[num_norm_files].size = pdirent->dirlen; num_norm_files ++; } @@ -320,7 +320,7 @@ static xine_mrl_t **smb_class_get_dir (input_class_t *this_gen, if (num_dir_files == 0) { dir_files[num_dir_files].link = NULL; dir_files[num_dir_files].origin = strdup(current_path); - asprintf(&(dir_files[num_dir_files].mrl), "%s/%s", current_path, ".."); + dir_files[num_dir_files].mrl = _x_asprintf("%s/..", current_path); dir_files[num_dir_files].type = mrl_file | mrl_file_directory; dir_files[num_dir_files].size = 0; num_dir_files ++; diff --git a/src/input/input_vcd.c b/src/input/input_vcd.c index 14b86a4c0..b15130500 100644 --- a/src/input/input_vcd.c +++ b/src/input/input_vcd.c @@ -1000,8 +1000,7 @@ static xine_mrl_t **vcd_class_get_dir (input_class_t *this_gen, const char *file memset(this->mrls[(i-1)], 0, sizeof(xine_mrl_t)); } - asprintf(&(this->mrls[i-1]->mrl), "vcdo:/%d", i); - + this->mrls[i-1]->mrl = _x_asprintf("vcdo:/%d", i); this->mrls[i-1]->type = mrl_vcd; /* hack */ @@ -1055,7 +1054,7 @@ static char ** vcd_class_get_autoplay_list (input_class_t *this_gen, int *num_fi /* FIXME: check if track 0 contains valid data */ for (i = 1; i < this->total_tracks; i++) - asprintf(&this->filelist[i-1], "vcdo:/%d", i); + this->filelist[i-1] = _x_asprintf("vcdo:/%d", i); /* printf ("%d tracks\n", this->total_tracks); */ diff --git a/src/input/librtsp/rtsp.c b/src/input/librtsp/rtsp.c index c8c5c4126..0e65d97d7 100644 --- a/src/input/librtsp/rtsp.c +++ b/src/input/librtsp/rtsp.c @@ -175,7 +175,7 @@ static void rtsp_send_request(rtsp_t *s, const char *type, const char *what) { char **payload=s->scheduled; char *buf; - asprintf(&buf,"%s %s %s",type, what, rtsp_protocol_version); + buf = _x_asprintf("%s %s %s",type, what, rtsp_protocol_version); rtsp_put(s,buf); if (payload) @@ -200,7 +200,7 @@ static void rtsp_schedule_standard(rtsp_t *s) { if (s->session) { char *buf; - asprintf(&buf, "Session: %s", s->session); + buf = _x_asprintf("Session: %s", s->session); rtsp_schedule_field(s, buf); } } @@ -296,7 +296,7 @@ int rtsp_request_options(rtsp_t *s, const char *what) { buf=strdup(what); } else { - asprintf(&buf,"rtsp://%s:%i", s->host, s->port); + buf = _x_asprintf("rtsp://%s:%i", s->host, s->port); } rtsp_send_request(s,"OPTIONS",buf); free(buf); @@ -312,7 +312,7 @@ int rtsp_request_describe(rtsp_t *s, const char *what) { buf=strdup(what); } else { - asprintf(&buf,"rtsp://%s:%i/%s", s->host, s->port, s->path); + buf = _x_asprintf("rtsp://%s:%i/%s", s->host, s->port, s->path); } rtsp_send_request(s,"DESCRIBE",buf); free(buf); @@ -335,7 +335,7 @@ int rtsp_request_setparameter(rtsp_t *s, const char *what) { buf=strdup(what); } else { - asprintf(&buf,"rtsp://%s:%i/%s", s->host, s->port, s->path); + buf = _x_asprintf("rtsp://%s:%i/%s", s->host, s->port, s->path); } rtsp_send_request(s,"SET_PARAMETER",buf); free(buf); @@ -351,7 +351,7 @@ int rtsp_request_play(rtsp_t *s, const char *what) { buf=strdup(what); } else { - asprintf(&buf,"rtsp://%s:%i/%s", s->host, s->port, s->path); + buf = _x_asprintf("rtsp://%s:%i/%s", s->host, s->port, s->path); } rtsp_send_request(s,"PLAY",buf); free(buf); @@ -402,7 +402,7 @@ int rtsp_read_data(rtsp_t *s, void *buffer_gen, unsigned int size) { } /* lets make the server happy */ rtsp_put(s, "RTSP/1.0 451 Parameter Not Understood"); - asprintf(&rest,"CSeq: %u", seq); + rest = _x_asprintf("CSeq: %u", seq); rtsp_put(s, rest); free(rest); rtsp_put(s, ""); diff --git a/src/libreal/real_common.c b/src/libreal/real_common.c index 0c607be86..c7ba38105 100644 --- a/src/libreal/real_common.c +++ b/src/libreal/real_common.c @@ -155,7 +155,7 @@ void *_x_real_codec_open(xine_stream_t *const stream, const char *const path, char *codecpath = NULL; void *codecmodule = NULL; - asprintf(&codecpath, "%s/%s", path, codec_name); + codecpath = _x_asprintf("%s/%s", path, codec_name); if ( (codecmodule = dlopen(codecpath, RTLD_NOW)) ) { free(codecpath); return codecmodule; @@ -167,7 +167,7 @@ void *_x_real_codec_open(xine_stream_t *const stream, const char *const path, free(codecpath); if ( codec_alternate ) { - asprintf(&codecpath, "%s/%s", path, codec_alternate); + codecpath = _x_asprintf("%s/%s", path, codec_alternate); if ( (codecmodule = dlopen(codecpath, RTLD_NOW)) ) { free(codecpath); return codecmodule; diff --git a/src/post/mosaico/mosaico.c b/src/post/mosaico/mosaico.c index 842588c01..79272e8db 100644 --- a/src/post/mosaico/mosaico.c +++ b/src/post/mosaico/mosaico.c @@ -179,7 +179,7 @@ static post_plugin_t *mosaico_open_plugin(post_class_t *class_gen, int inputs, this->pip[i].y = 50; this->pip[i].w = 150; this->pip[i].h = 150; - asprintf(&(this->pip[i].input_name), "video in %d", i+1); + this->pip[i].input_name = _x_asprintf("video in %d", i+1); port = _x_post_intercept_video_port(&this->post, video_target[0], &input, NULL); port->new_port.close = mosaico_close; diff --git a/src/post/planar/pp.c b/src/post/planar/pp.c index 767d52f96..ab1fc3a9f 100644 --- a/src/post/planar/pp.c +++ b/src/post/planar/pp.c @@ -123,16 +123,17 @@ static char * get_help (void) { static char *help = NULL; if( !help ) { - asprintf(&help, "%s%s%s", - _("FFmpeg libpostprocess plugin.\n" - "\n" - "Parameters\n" - "\n"), - pp_help, - _("\n" - "* libpostprocess (C) Michael Niedermayer\n") - ); + help = _x_asprintf("%s%s%s", + _("FFmpeg libpostprocess plugin.\n" + "\n" + "Parameters\n" + "\n"), + pp_help, + _("\n" + "* libpostprocess (C) Michael Niedermayer\n") + ); } + return help; } diff --git a/src/vdr/input_vdr.c b/src/vdr/input_vdr.c index 2b0329867..9a6ced8d0 100644 --- a/src/vdr/input_vdr.c +++ b/src/vdr/input_vdr.c @@ -1958,7 +1958,7 @@ static int vdr_plugin_open_fifo_mrl(input_plugin_t *this_gen) { char *filename_control = 0; - asprintf(&filename_control, "%s.control", filename); + filename_control = _x_asprintf("%s.control", filename); this->fh_control = xine_open_cloexec(filename_control, O_RDONLY); @@ -1978,7 +1978,7 @@ static int vdr_plugin_open_fifo_mrl(input_plugin_t *this_gen) { char *filename_result = 0; - asprintf(&filename_result, "%s.result", filename); + filename_result = _x_asprintf("%s.result", filename); this->fh_result = xine_open_cloexec(filename_result, O_WRONLY); @@ -2000,7 +2000,7 @@ static int vdr_plugin_open_fifo_mrl(input_plugin_t *this_gen) { char *filename_event = 0; - asprintf(&filename_event, "%s.event", filename); + filename_event = _x_asprintf("%s.event", filename); this->fh_event = xine_open_cloexec(filename_event, O_WRONLY); diff --git a/src/video_out/video_out_opengl.c b/src/video_out/video_out_opengl.c index 2028cd999..5d8b60651 100644 --- a/src/video_out/video_out_opengl.c +++ b/src/video_out/video_out_opengl.c @@ -705,7 +705,7 @@ static void *getdladdr (const GLubyte *_funcName) { #elif defined(__APPLE__) char *temp; - asprintf(&temp, "_%s", funcName); + temp = _x_asprintf("_%s", funcName); void *res = NULL; if (NSIsSymbolNameDefined (temp)) { NSSymbol symbol = NSLookupAndBindSymbol (temp); diff --git a/src/xine-engine/configfile.c b/src/xine-engine/configfile.c index b82db8b77..0eada28b4 100644 --- a/src/xine-engine/configfile.c +++ b/src/xine-engine/configfile.c @@ -375,7 +375,7 @@ static const char *config_translate_key (const char *key, char **tmp) { *tmp = NULL; if (!strncmp (key, "decoder.", 8) && !strcmp (key + (trans = strlen (key)) - 9, "_priority")) { - asprintf (tmp, "engine.decoder_priorities.%.*s", trans - 17, key + 8); + *tmp = _x_asprintf ("engine.decoder_priorities.%.*s", trans - 17, key + 8); return *tmp; } diff --git a/src/xine-engine/load_plugins.c b/src/xine-engine/load_plugins.c index f5db64bc0..3063ba4df 100644 --- a/src/xine-engine/load_plugins.c +++ b/src/xine-engine/load_plugins.c @@ -388,7 +388,7 @@ static void _insert_node (xine_t *this, snprintf(key, sizeof(key), "engine.decoder_priorities.%s", info->id); for (i = 0; catalog->prio_desc[i]; i++); - asprintf(&catalog->prio_desc[i], _("priority for %s decoder"), info->id); + catalog->prio_desc[i] = _x_asprintf(_("priority for %s decoder"), info->id); this->config->register_num (this->config, key, 0, @@ -1199,7 +1199,7 @@ static void save_catalog (xine_t *this) { if ( ! cachefile ) return; - asprintf(&cachefile_new, "%s.new", cachefile); + cachefile_new = _x_asprintf("%s.new", cachefile); if( (fp = fopen(cachefile_new,"w")) != NULL ) { int i; @@ -1298,7 +1298,7 @@ void _x_scan_plugins (xine_t *this) { } else len = strlen(q); if (q[0] == '~' && q[1] == '/') - asprintf (&dir, "%s%.*s", homedir, (int)(len - 1), q + 1); + dir = _x_asprintf ("%s%.*s", homedir, (int)(len - 1), q + 1); else dir = strndup (q, len); push_if_dir (plugindirs, dir); /* store or free it */ @@ -1306,11 +1306,11 @@ void _x_scan_plugins (xine_t *this) { } else { char *dir; int i; - asprintf (&dir, "%s/.xine/plugins", homedir); + dir = _x_asprintf ("%s/.xine/plugins", homedir); push_if_dir (plugindirs, dir); for (i = 0; i <= XINE_LT_AGE; ++i) { - asprintf (&dir, "%s.%d", XINE_PLUGINROOT, XINE_LT_AGE - i); + dir = _x_asprintf ("%s.%d", XINE_PLUGINROOT, XINE_LT_AGE - i); push_if_dir (plugindirs, dir); } } diff --git a/src/xine-engine/osd.c b/src/xine-engine/osd.c index 8e48da99d..c827607b1 100644 --- a/src/xine-engine/osd.c +++ b/src/xine-engine/osd.c @@ -1085,7 +1085,7 @@ static int osd_lookup_xdg( osd_object_t *osd, const char *const fontname ) { while( (*data_dirs) && *(*data_dirs) ) { FT_Error fte = FT_Err_Ok; char *fontpath = NULL; - asprintf(&fontpath, "%s/"PACKAGE"/fonts/%s", *data_dirs, fontname); + fontpath = _x_asprintf("%s/"PACKAGE"/fonts/%s", *data_dirs, fontname); fte = FT_New_Face(osd->ft2->library, fontpath, 0, &osd->ft2->face); @@ -1661,7 +1661,7 @@ static void osd_preload_fonts (osd_renderer_t *this, char *path) { lprintf("font '%s' size %d is preloaded\n", font->name, font->size); - asprintf (&font->filename, "%s/%s", path, entry->d_name); + font->filename = _x_asprintf ("%s/%s", path, entry->d_name); font->next = this->fonts; this->fonts = font; diff --git a/src/xine-utils/xmlparser.c b/src/xine-utils/xmlparser.c index ba0c51994..8619b1be8 100644 --- a/src/xine-utils/xmlparser.c +++ b/src/xine-utils/xmlparser.c @@ -213,7 +213,8 @@ static xml_node_t *xml_parser_append_text (xml_node_t *node, xml_node_t *subnode if (subnode->name == cdata) { /* most recent node is CDATA - append to it */ char *newtext; - asprintf (&newtext, "%s%s", subnode->data, text); + if (asprintf (&newtext, "%s%s", subnode->data, text) < 0) + newtext = NULL; free (subnode->data); subnode->data = newtext; } else { @@ -226,7 +227,8 @@ static xml_node_t *xml_parser_append_text (xml_node_t *node, xml_node_t *subnode } else if (node->data) { /* "no" subtree, but we have existing text - append to it */ char *newtext; - asprintf (&newtext, "%s%s", node->data, text); + if (asprintf (&newtext, "%s%s", node->data, text) < 0) + newtext = NULL; free (node->data); node->data = newtext; } else { @@ -327,7 +329,8 @@ static int xml_parser_get_node_internal (xml_parser_t *xml_parser, strtoupper(tok); } if (state == STATE_Q_NODE) { - asprintf (&node_name, "?%s", tok); + if (asprintf (&node_name, "?%s", tok) < 0) + node_name = NULL; free (*nname_buffer); *nname_buffer = node_name; *nname_buffer_size = strlen (node_name) + 1; |