diff options
author | Petri Hintukainen <phintuka@users.sourceforge.net> | 2011-10-10 12:41:10 +0300 |
---|---|---|
committer | Petri Hintukainen <phintuka@users.sourceforge.net> | 2011-10-10 12:41:10 +0300 |
commit | 9f105cfe9059df4a9a1f5278679151a5d9c387f6 (patch) | |
tree | 8cb7a3700bd94fbb54e51d32dc353355f3f27b09 /src | |
parent | 83049ca9ad0d39a5795b586b76f954748a3de316 (diff) | |
download | xine-lib-9f105cfe9059df4a9a1f5278679151a5d9c387f6.tar.gz xine-lib-9f105cfe9059df4a9a1f5278679151a5d9c387f6.tar.bz2 |
Fixed asprintf usage
Diffstat (limited to 'src')
-rw-r--r-- | src/dxr3/video_out_dxr3.c | 2 | ||||
-rw-r--r-- | src/input/http_helper.c | 7 | ||||
-rw-r--r-- | src/input/input_cdda.c | 4 | ||||
-rw-r--r-- | src/input/input_dvb.c | 11 | ||||
-rw-r--r-- | src/input/input_dvd.c | 6 | ||||
-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 | 2 | ||||
-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 | 16 | ||||
-rw-r--r-- | src/xine-engine/osd.c | 2 | ||||
-rw-r--r-- | src/xine-engine/xine.c | 2 | ||||
-rw-r--r-- | src/xine-utils/xmlparser.c | 2 |
21 files changed, 57 insertions, 69 deletions
diff --git a/src/dxr3/video_out_dxr3.c b/src/dxr3/video_out_dxr3.c index 5718c0687..ed5ae4b58 100644 --- a/src/dxr3/video_out_dxr3.c +++ b/src/dxr3/video_out_dxr3.c @@ -1361,7 +1361,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.c b/src/input/http_helper.c index eb28140ff..90ee63c92 100644 --- a/src/input/http_helper.c +++ b/src/input/http_helper.c @@ -28,6 +28,7 @@ #include "xine_internal.h" #include "http_helper.h" +#include "xineutils.h" const char *_x_url_user_agent (const char *url) @@ -237,7 +238,7 @@ error: 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); @@ -254,8 +255,8 @@ char *_x_canonicalise_url (const char *base, const char *url) { ++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); } #ifdef TEST_URL diff --git a/src/input/input_cdda.c b/src/input/input_cdda.c index b2a4b117e..22dfcac4c 100644 --- a/src/input/input_cdda.c +++ b/src/input/input_cdda.c @@ -1495,7 +1495,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); } } } @@ -2652,7 +2652,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 fc6e2b7c4..145abc773 100644 --- a/src/input/input_dvb.c +++ b/src/input/input_dvb.c @@ -3249,7 +3249,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); } @@ -3257,10 +3257,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); @@ -3296,9 +3296,8 @@ static void *init_class (xine_t *xine, void *data) { this->mrls[4] = "dvba://"; this->mrls[5] = 0; - asprintf(&this->default_channels_conf_filename, - "%s/.xine/channels.conf", - xine_get_homedir()); + this->default_channels_conf_filename = _x_asprintf("%s/.xine/channels.conf", + xine_get_homedir()); xprintf(this->xine,XINE_VERBOSITY_DEBUG,"init class succeeded\n"); diff --git a/src/input/input_dvd.c b/src/input/input_dvd.c index 27e49e05a..8ad875a41 100644 --- a/src/input/input_dvd.c +++ b/src/input/input_dvd.c @@ -1380,8 +1380,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; } @@ -1828,7 +1828,7 @@ static void *init_class (xine_t *xine, void *data) { "playing scrambled DVDs."), 20, NULL, NULL); xine_setenv("DVDCSS_METHOD", decrypt_modes[mode], 0); - asprintf(&css_cache_default, "%s/.dvdcss/", xine_get_homedir()); + css_cache_default = _x_asprintf("%s/.dvdcss/", xine_get_homedir()); css_cache = config->register_filename(config, "media.dvd.css_cache_path", css_cache_default, XINE_CONFIG_STRING_IS_DIRECTORY_NAME, _("path to the title key cache"), _("Since cracking the copy protection of scrambled DVDs can " diff --git a/src/input/input_file.c b/src/input/input_file.c index d5313d4dc..bb8afef92 100644 --- a/src/input/input_file.c +++ b/src/input/input_file.c @@ -720,8 +720,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); @@ -756,8 +755,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); @@ -788,8 +786,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 35fff8ce0..aec74bd5d 100644 --- a/src/input/input_http.c +++ b/src/input/input_http.c @@ -1041,7 +1041,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 875fb84b0..4aa55f440 100644 --- a/src/input/input_pvr.c +++ b/src/input/input_pvr.c @@ -509,36 +509,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 fbfad0364..0b7629767 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 5d97d7518..d82ab0aa7 100644 --- a/src/input/input_smb.c +++ b/src/input/input_smb.c @@ -274,7 +274,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){ @@ -282,14 +282,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){ @@ -297,7 +297,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 ++; @@ -306,7 +306,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 ++; } @@ -314,14 +314,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 ++; } @@ -331,7 +331,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 20bf8c845..3f31c7c9d 100644 --- a/src/input/input_vcd.c +++ b/src/input/input_vcd.c @@ -1006,8 +1006,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 */ @@ -1061,7 +1060,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 ebac49079..4611378f8 100644 --- a/src/input/librtsp/rtsp.c +++ b/src/input/librtsp/rtsp.c @@ -177,7 +177,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); free(buf); if (payload) @@ -202,7 +202,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); free(buf); } @@ -299,7 +299,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); @@ -315,7 +315,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); @@ -338,7 +338,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); @@ -354,7 +354,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); @@ -403,7 +403,7 @@ int rtsp_read_data(rtsp_t *s, char *buffer, 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 a22abf789..bcdd7ff00 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 ec46e1ca0..9a9a9911c 100644 --- a/src/post/mosaico/mosaico.c +++ b/src/post/mosaico/mosaico.c @@ -182,7 +182,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 6b805e20b..3753c2ce2 100644 --- a/src/post/planar/pp.c +++ b/src/post/planar/pp.c @@ -132,7 +132,7 @@ static char * get_help (void) { static char *help = NULL; if( !help ) - asprintf(&help, "%s%s%s", help1, help2, pp_help); + help = _x_asprintf("%s%s%s", help1, help2, pp_help); return help; } diff --git a/src/video_out/video_out_opengl.c b/src/video_out/video_out_opengl.c index 76040f623..751e39991 100644 --- a/src/video_out/video_out_opengl.c +++ b/src/video_out/video_out_opengl.c @@ -700,7 +700,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 507f0a81d..ca82c7b9e 100644 --- a/src/xine-engine/configfile.c +++ b/src/xine-engine/configfile.c @@ -371,7 +371,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 9eb33f8ed..0080bc30c 100644 --- a/src/xine-engine/load_plugins.c +++ b/src/xine-engine/load_plugins.c @@ -381,7 +381,7 @@ static void _insert_node (xine_t *this, * does not strdup() it, so we have to provide a different pointer * for each decoder */ 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, @@ -1068,11 +1068,11 @@ static void save_catalog (xine_t *this) { const char *const homedir = xine_get_homedir(); - asprintf(&cachefile, "%s/%s", homedir, relname); - asprintf(&cachefile_new, "%s.new", cachefile); + cachefile = _x_asprintf("%s/%s", homedir, relname); + cachefile_new = _x_asprintf("%s.new", cachefile); /* make sure homedir (~/.xine) exists */ - asprintf(&dirfile, "%s/%s", homedir, dirname); + dirfile = _x_asprintf("%s/%s", homedir, dirname); mkdir (dirfile, 0755); free (dirfile); @@ -1119,7 +1119,7 @@ static void load_cached_catalog (xine_t *this) { char *cachefile; const char *relname = CACHE_CATALOG_FILE; - asprintf(&cachefile, "%s/%s", xine_get_homedir(), relname); + cachefile = _x_asprintf("%s/%s", xine_get_homedir(), relname); if( (fp = fopen(cachefile,"r")) != NULL ) { load_plugin_list (fp, this->plugin_catalog->cache_list); @@ -1175,7 +1175,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 */ @@ -1183,11 +1183,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 94fc969bd..32e5e36fd 100644 --- a/src/xine-engine/osd.c +++ b/src/xine-engine/osd.c @@ -1426,7 +1426,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-engine/xine.c b/src/xine-engine/xine.c index 78d144b1f..b95a14292 100644 --- a/src/xine-engine/xine.c +++ b/src/xine-engine/xine.c @@ -1672,7 +1672,7 @@ static void config_save_cb (void *this_gen, xine_cfg_entry_t *entry) { xine_t *this = (xine_t *)this_gen; char *homedir_trail_slash; - asprintf(&homedir_trail_slash, "%s/", xine_get_homedir()); + homedir_trail_slash = _x_asprintf("%s/", xine_get_homedir()); if (entry->str_value[0] && (entry->str_value[0] != '/' || strstr(entry->str_value, "/.") || strcmp(entry->str_value, xine_get_homedir()) == 0 || diff --git a/src/xine-utils/xmlparser.c b/src/xine-utils/xmlparser.c index def9c3d17..1b82074fb 100644 --- a/src/xine-utils/xmlparser.c +++ b/src/xine-utils/xmlparser.c @@ -637,7 +637,7 @@ static void xml_parser_dump_node (const xml_node_t *node, int indent) { free (value); p = p->next; if (p) { - printf ("\n%*s", indent+2+l, ""); + printf ("\n%*s", (int)(indent+2+l), ""); } } printf (">\n"); |