[prev in list] [next in list] [prev in thread] [next in thread]
List: xine-cvslog
Subject: [xine-cvs] CVS: xine-ui/src/xitk actions.c,1.265,1.266 file_browser.c,1.60,1.61 kbindings.c,1.128,1.
From: Matthias Hopf <mshopf () users ! sourceforge ! net>
Date: 2006-05-22 17:53:29
Message-ID: E1FiEav-0002ev-4e () sc8-pr-cvs10 ! sourceforge ! net
[Download RAW message or body]
Update of /cvsroot/xine/xine-ui/src/xitk
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv9859/src/xitk
Modified Files:
actions.c file_browser.c kbindings.c main.c mediamark.c
network.c osd.c stream_infos.c viewlog.c
Log Message:
Fixed misuse of sprintf (Andreas Schwab).
Index: actions.c
===================================================================
RCS file: /cvsroot/xine/xine-ui/src/xitk/actions.c,v
retrieving revision 1.265
retrieving revision 1.266
diff -u -r1.265 -r1.266
--- actions.c 30 Oct 2005 02:19:32 -0000 1.265
+++ actions.c 22 May 2006 17:53:26 -0000 1.266
@@ -380,7 +380,7 @@
minfo = xine_get_meta_info(stream, XINE_META_INFO_VIDEOCODEC);
vfcc = xine_get_stream_info(stream, XINE_STREAM_INFO_VIDEO_FOURCC);
- sprintf(buffer, _("%sVideo Codec: %s (%s)\n"), buffer,
+ sprintf(buffer+strlen(buffer), _("%sVideo Codec: %s (%s)\n"), NULL,
(minfo && strlen(minfo)) ? (char *) minfo : _("Unavailable"),
(get_fourcc_string(vfcc)));
}
@@ -391,7 +391,7 @@
minfo = xine_get_meta_info(stream, XINE_META_INFO_AUDIOCODEC);
afcc = xine_get_stream_info(stream, XINE_STREAM_INFO_AUDIO_FOURCC);
- sprintf(buffer, _("%sAudio Codec: %s (%s)\n"), buffer,
+ sprintf(buffer+strlen(buffer), _("%sAudio Codec: %s (%s)\n"), NULL,
(minfo && strlen(minfo)) ? (char *) minfo : _("Unavailable"),
(get_fourcc_string(afcc)));
}
@@ -405,7 +405,7 @@
if(!gGui->play_anyway) {
xitk_window_t *xw;
- sprintf(buffer, _("%s\nStart playback anyway ?\n"), buffer);
+ sprintf(buffer+strlen(buffer), _("%s\nStart playback anyway ?\n"), NULL);
play_data.stream = stream;
play_data.start_pos = start_pos;
Index: file_browser.c
===================================================================
RCS file: /cvsroot/xine/xine-ui/src/xitk/file_browser.c,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -r1.60 -r1.61
--- file_browser.c 24 Jan 2006 21:45:55 -0000 1.60
+++ file_browser.c 22 May 2006 17:53:26 -0000 1.61
@@ -983,7 +983,7 @@
snprintf(buf, sizeof(buf), "%s", fb->current_dir);
if(strlen(fb->current_dir) > 1)
strcat(buf, "/");
- sprintf(buf, "%s%s", buf, fb->norm_files[sel].name);
+ strcat(buf, fb->norm_files[sel].name);
if((unlink(buf)) == -1)
xine_error(_("Unable to delete file '%s': %s."), buf, strerror(errno));
@@ -1006,7 +1006,7 @@
snprintf(buf, sizeof(buf), _("Do you really want to delete the file: '%s'"), \
fb->current_dir); if(strlen(fb->current_dir) > 1)
strcat(buf, "/");
- sprintf(buf, "%s%s' ?.", buf, fb->norm_files[sel].name);
+ sprintf(buf+strlen(buf), "%s' ?.", fb->norm_files[sel].name);
fb_deactivate(fb);
xitk_window_dialog_yesno(gGui->imlib_data, _("Confirm deletion ?"),
@@ -1025,7 +1025,7 @@
snprintf(buf, sizeof(buf), "%s", fb->current_dir);
if(strlen(fb->current_dir) > 1)
strcat(buf, "/");
- sprintf(buf, "%s%s", buf, fb->norm_files[sel].name);
+ strcat(buf, fb->norm_files[sel].name);
if((rename(buf, newname)) == -1)
xine_error(_("Unable to rename file '%s' to '%s': %s."), buf, newname, \
strerror(errno)); @@ -1044,7 +1044,7 @@
snprintf(buf, sizeof(buf), "%s", fb->current_dir);
if(strlen(fb->current_dir) > 1)
strcat(buf, "/");
- sprintf(buf, "%s%s", buf, fb->norm_files[sel].name);
+ strcat(buf, fb->norm_files[sel].name);
fb_deactivate(fb);
fb_create_input_window(_("Rename file"), buf, fb_rename_file_cb, fb);
Index: kbindings.c
===================================================================
RCS file: /cvsroot/xine/xine-ui/src/xitk/kbindings.c,v
retrieving revision 1.128
retrieving revision 1.129
diff -u -r1.128 -r1.129
--- kbindings.c 20 Apr 2006 19:02:13 -0000 1.128
+++ kbindings.c 22 May 2006 17:53:26 -0000 1.129
@@ -605,7 +605,7 @@
else {
len += 2;
kmsg = (char *) realloc(kmsg, strlen(kmsg) + len + 1);
- sprintf(kmsg, "%s%s%s%c%s%c%s", kmsg, ", ", action1, ' ', dna, ' ', action2);
+ sprintf(kmsg+strlen(kmsg), "%s%s%c%s%c%s", ", ", action1, ' ', dna, ' ', \
action2); }
}
}
@@ -617,7 +617,7 @@
char *footer = _(".\n\nWhat do you want to do ?\n");
kmsg = (char *) realloc(kmsg, strlen(kmsg) + strlen(footer) + 1);
- sprintf(kmsg, "%s%s", kmsg, footer);
+ strcat(kmsg, footer);
dump_error(gGui->verbosity, kmsg);
@@ -1018,15 +1018,14 @@
for(k = kbt->entry, i = 0; k[i]->action != NULL; i++) {
if(!k[i]->is_alias) {
sprintf(buf, "# %s\n", k[i]->comment);
- sprintf(buf, "%sbegin\n", buf);
- sprintf(buf, "%s\tremote = xxxxx\n", buf);
- sprintf(buf, "%s\tbutton = xxxxx\n", buf);
- sprintf(buf, "%s\tprog = xine\n", buf);
- sprintf(buf, "%s\trepeat = 0\n", buf);
- sprintf(buf, "%s\tconfig = %s\n", buf, k[i]->action);
- sprintf(buf, "%send\n\n", buf);
+ strcat(buf, "begin\n");
+ strcat(buf, "\tremote = xxxxx\n");
+ strcat(buf, "\tbutton = xxxxx\n");
+ strcat(buf, "\tprog = xine\n");
+ strcat(buf, "\trepeat = 0\n");
+ sprintf(buf+strlen(buf), "\tconfig = %s\n", k[i]->action);
+ strcat(buf, "end\n\n");
fputs(buf, stream);
- memset(&buf, 0, sizeof(buf));
}
}
fprintf(stream, "##\n# End of xine key bindings.\n##\n");
@@ -1041,31 +1040,30 @@
snprintf(buf, sizeof(buf), "# %s\n", k[i]->comment);
if(k[i]->is_alias) {
- sprintf(buf, "%sAlias {\n", buf);
- sprintf(buf, "%s\tentry = %s\n", buf, k[i]->action);
+ strcat(buf, "Alias {\n");
+ sprintf(buf+strlen(buf), "\tentry = %s\n", k[i]->action);
}
else
- sprintf(buf, "%s%s {\n", buf, k[i]->action);
+ sprintf(buf+strlen(buf), "%s {\n", k[i]->action);
- sprintf(buf, "%s\tkey = %s\n", buf, k[i]->key);
- sprintf(buf, "%s%s", buf, "\tmodifier = ");
+ sprintf(buf+strlen(buf), "\tkey = %s\n", k[i]->key);
+ strcat(buf, "\tmodifier = ");
if(k[i]->modifier == KEYMOD_NOMOD)
- sprintf(buf, "%s%s, ", buf, "none");
+ strcat(buf, "none, ");
if(k[i]->modifier & KEYMOD_CONTROL)
- sprintf(buf, "%s%s, ", buf, "control");
+ strcat(buf, "control, ");
if(k[i]->modifier & KEYMOD_META)
- sprintf(buf, "%s%s, ", buf, "meta");
+ strcat(buf, "meta, ");
if(k[i]->modifier & KEYMOD_MOD3)
- sprintf(buf, "%s%s, ", buf, "mod3");
+ strcat(buf, "mod3, ");
if(k[i]->modifier & KEYMOD_MOD4)
- sprintf(buf, "%s%s, ", buf, "mod4");
+ strcat(buf, "mod4, ");
if(k[i]->modifier & KEYMOD_MOD5)
- sprintf(buf, "%s%s, ", buf, "mod5");
+ strcat(buf, "mod5, ");
buf[strlen(buf) - 2] = '\n';
buf[strlen(buf) - 1] = '\0';
- sprintf(buf, "%s%s", buf, "}\n\n");
+ strcat(buf, "}\n\n");
fprintf(stream, "%s", buf);
- memset(&buf, 0, sizeof(buf));
}
fprintf(stream, "##\n# End of xine key bindings.\n##\n");
break;
@@ -1274,34 +1272,34 @@
static char shortcut[32];
if(kbe) {
- memset(&shortcut, 0, sizeof(shortcut));
+ shortcut[0] = 0;
if(gGui->shortcut_style == 0) {
if(kbe->modifier & KEYMOD_CONTROL)
- sprintf(shortcut, "%s%s+", shortcut, _("Ctrl"));
+ sprintf(shortcut+strlen(shortcut), "%s+", _("Ctrl"));
if(kbe->modifier & KEYMOD_META)
- sprintf(shortcut, "%s%s+", shortcut, _("Alt"));
+ sprintf(shortcut+strlen(shortcut), "%s+", _("Alt"));
if(kbe->modifier & KEYMOD_MOD3)
- sprintf(shortcut, "%s%s+", shortcut, "M3");
+ strcat(shortcut, "M3+");
if(kbe->modifier & KEYMOD_MOD4)
- sprintf(shortcut, "%s%s+", shortcut, "M4");
+ strcat(shortcut, "M4+");
if(kbe->modifier & KEYMOD_MOD5)
- sprintf(shortcut, "%s%s+", shortcut, "M5");
+ strcat(shortcut, "M5+");
}
else {
if(kbe->modifier & KEYMOD_CONTROL)
- sprintf(shortcut, "%s%s-", shortcut, "C");
+ strcat(shortcut, "C-");
if(kbe->modifier & KEYMOD_META)
- sprintf(shortcut, "%s%s-", shortcut, "M");
+ strcat(shortcut, "M-");
if(kbe->modifier & KEYMOD_MOD3)
- sprintf(shortcut, "%s%s-", shortcut, "M3");
+ strcat(shortcut, "M3-");
if(kbe->modifier & KEYMOD_MOD4)
- sprintf(shortcut, "%s%s-", shortcut, "M4");
+ strcat(shortcut, "M4-");
if(kbe->modifier & KEYMOD_MOD5)
- sprintf(shortcut, "%s%s-", shortcut, "M5");
+ strcat(shortcut, "M5-");
}
- sprintf(shortcut, "%s%s", shortcut, kbe->key);
+ strcat(shortcut, kbe->key);
return shortcut;
}
@@ -1852,7 +1850,7 @@
case KBEDIT_EDITING:
kbedit->ksel->key = (char *) realloc(kbedit->ksel->key, sizeof(char *) * \
(strlen(kbe->key) + 1));
- sprintf(kbedit->ksel->key, "%s", kbe->key);
+ strcpy(kbedit->ksel->key, kbe->key);
kbedit->ksel->modifier = kbe->modifier;
kbedit_create_browser_entries();
@@ -2493,26 +2491,26 @@
memset(&buf, 0, sizeof(buf));
if(k[i]->modifier & KEYMOD_CONTROL)
- sprintf(buf, "%s", "\\fBC\\fP");
+ strcpy(buf, "\\fBC\\fP");
if(k[i]->modifier & KEYMOD_META) {
- if(strlen(buf))
- sprintf(buf, "%s%s", buf, "\\-");
- sprintf(buf, "%s%s", buf, "\\fBM\\fP");
+ if(buf[0])
+ strcat(buf, "\\-");
+ strcat(buf, "\\fBM\\fP");
}
if(k[i]->modifier & KEYMOD_MOD3) {
- if(strlen(buf))
- sprintf(buf, "%s%s", buf, "\\-");
- sprintf(buf, "%s%s", buf, "\\fBM3\\fP");
+ if(buf[0])
+ strcat(buf, "\\-");
+ strcat(buf, "\\fBM3\\fP");
}
if(k[i]->modifier & KEYMOD_MOD4) {
- if(strlen(buf))
- sprintf(buf, "%s%s", buf, "\\-");
- sprintf(buf, "%s%s", buf, "\\fBM4\\fP");
+ if(buf[0])
+ strcat(buf, "\\-");
+ strcat(buf, "\\fBM4\\fP");
}
if(k[i]->modifier & KEYMOD_MOD5) {
- if(strlen(buf))
- sprintf(buf, "%s%s", buf, "\\-");
- sprintf(buf, "%s%s", buf, "\\fBM5\\fP");
+ if(buf[0])
+ strcat(buf, "\\-");
+ strcat(buf, "\\fBM5\\fP");
}
printf("%s\\-", buf);
}
Index: main.c
===================================================================
RCS file: /cvsroot/xine/xine-ui/src/xitk/main.c,v
retrieving revision 1.313
retrieving revision 1.314
diff -u -r1.313 -r1.314
--- main.c 20 Apr 2006 19:02:13 -0000 1.313
+++ main.c 22 May 2006 17:53:26 -0000 1.314
@@ -461,7 +461,7 @@
printf("%s", title);
- sprintf(buffer, "%s", blanks);
+ strcpy(buffer, blanks);
plugin = *plugins++;
while(plugin) {
@@ -469,7 +469,7 @@
len = strlen(buffer);
if((len + (strlen(plugin) + 3)) < 80) {
- sprintf(buffer, "%s%s%s", buffer, (strlen(buffer) == strlen(blanks)) ? "" : ", \
", plugin); + sprintf(buffer+strlen(buffer), "%s%s", (strlen(buffer) == \
strlen(blanks)) ? "" : ", ", plugin); }
else {
printf("%s", buffer);
@@ -1118,9 +1118,9 @@
"%s:", _("*drum roll*, xine lib wants to take your attention "
"to deliver an important message to you ;-):"));
if(data->explanation)
- sprintf(buffer, "%s %s %s", buffer, (char *) data + data->explanation, (char *) \
data + data->parameters); + sprintf(buffer+strlen(buffer), " %s %s", (char *) data \
+ data->explanation, (char *) data + data->parameters); else
- sprintf(buffer, "%s %s", buffer, _("No Information available."));
+ sprintf(buffer+strlen(buffer), " %s", _("No Information available."));
break;
@@ -1129,14 +1129,14 @@
snprintf(buffer, sizeof(buffer), "%s", _("The host you're trying to connect is \
unknown.\n" "Check the validity of the specified hostname."));
if(data->explanation)
- sprintf(buffer, "%s (%s)", buffer, (char *) data + data->parameters);
+ sprintf(buffer+strlen(buffer), " (%s)", (char *) data + data->parameters);
break;
/* (device name) */
case XINE_MSG_UNKNOWN_DEVICE:
snprintf(buffer, sizeof(buffer), "%s", _("The device name you specified seems \
invalid.")); if(data->explanation)
- sprintf(buffer, "%s (%s)", buffer, (char *) data + data->parameters);
+ sprintf(buffer+strlen(buffer), " (%s)", (char *) data + data->parameters);
break;
/* none */
@@ -1144,21 +1144,21 @@
snprintf(buffer, sizeof(buffer), "%s", _("The network looks unreachable.\nCheck \
your network " "setup and/or the server name."));
if(data->explanation)
- sprintf(buffer, "%s (%s)", buffer, (char *) data + data->parameters);
+ sprintf(buffer+strlen(buffer), " (%s)", (char *) data + data->parameters);
break;
/* (host name) */
case XINE_MSG_CONNECTION_REFUSED:
snprintf(buffer, sizeof(buffer), "%s", _("The connection was refused.\nCheck the \
host name.")); if(data->explanation)
- sprintf(buffer, "%s (%s)", buffer, (char *) data + data->parameters);
+ sprintf(buffer+strlen(buffer), " (%s)", (char *) data + data->parameters);
break;
/* (file name or mrl) */
case XINE_MSG_FILE_NOT_FOUND:
snprintf(buffer, sizeof(buffer), "%s", _("The specified file or mrl is not found. \
Please check it twice.")); if(data->explanation)
- sprintf(buffer, "%s (%s)", buffer, (char *) data + data->parameters);
+ sprintf(buffer+strlen(buffer), " (%s)", (char *) data + data->parameters);
break;
/* (device/file/mrl) */
@@ -1167,27 +1167,27 @@
"rights for this, or source doesn't contain data "
"(e.g: not disc in drive)."));
if(data->explanation)
- sprintf(buffer, "%s (%s)", buffer, (char *) data + data->parameters);
+ sprintf(buffer+strlen(buffer), " (%s)", (char *) data + data->parameters);
break;
/* (library/decoder) */
case XINE_MSG_LIBRARY_LOAD_ERROR:
snprintf(buffer, sizeof(buffer), "%s", _("A problem occur while loading a library \
or a decoder")); if(data->explanation)
- sprintf(buffer, "%s: %s", buffer, (char *) data + data->parameters);
+ sprintf(buffer+strlen(buffer), ": %s", (char *) data + data->parameters);
break;
/* none */
case XINE_MSG_ENCRYPTED_SOURCE:
snprintf(buffer, sizeof(buffer), "%s", _("The source seems encrypted, and can't be \
read.")); if(!strncasecmp(gGui->mmk.mrl, "dvd:/", 5)) {
- sprintf(buffer, "%s%s", buffer, _("\nYour DVD is probably crypted. "
- "According to your country laws, you can or can't "
- "install/use libdvdcss to be able to read this disc, "
- "which you bought."));
+ strcat(buffer, _("\nYour DVD is probably crypted. "
+ "According to your country laws, you can or can't "
+ "install/use libdvdcss to be able to read this disc, "
+ "which you bought."));
}
if(data->explanation)
- sprintf(buffer, "%s (%s)", buffer, (char *) data + data->parameters);
+ sprintf(buffer+strlen(buffer), " (%s)", (char *) data + data->parameters);
break;
/* (warning message) */
@@ -1208,17 +1208,17 @@
default:
snprintf(buffer, sizeof(buffer), "%s", _("*sight*, unkown error."));
if(data->explanation)
- sprintf(buffer, "%s (%s %s)", buffer, (char *) data + data->explanation, (char *) \
data + data->parameters); + sprintf(buffer+strlen(buffer), " (%s %s)", (char *) \
data + data->explanation, (char *) data + data->parameters); break;
}
if(gGui->verbosity >= XINE_VERBOSITY_DEBUG) {
- sprintf(buffer, "%s\n\n[", buffer);
+ strcat(buffer, "\n\n[");
if(data->explanation)
- sprintf(buffer, "%s'%s' '%s'", buffer, (char *) data + data->explanation, (char \
*) data + data->parameters); + sprintf(buffer+strlen(buffer), "'%s' '%s'", (char *) \
data + data->explanation, (char *) data + data->parameters);
- sprintf(buffer, "%s]", buffer);
+ strcat(buffer, "]");
}
if(strlen(buffer))
Index: mediamark.c
===================================================================
RCS file: /cvsroot/xine/xine-ui/src/xitk/mediamark.c,v
retrieving revision 1.102
retrieving revision 1.103
diff -u -r1.102 -r1.103
--- mediamark.c 21 Feb 2006 01:04:00 -0000 1.102
+++ mediamark.c 22 May 2006 17:53:26 -0000 1.103
@@ -1122,10 +1122,10 @@
if(atitle && strlen(atitle)) {
real_title = (char *) xine_xmalloc(len);
- sprintf(real_title, "%s", atitle);
+ strcpy(real_title, atitle);
if(aauthor && strlen(aauthor))
- sprintf(real_title, "%s (%s)", real_title, aauthor);
+ sprintf(real_title+strlen(real_title), " (%s)", aauthor);
}
mmk = (mediamark_t **) realloc(mmk, sizeof(mediamark_t *) * (entries_asx + 2));
Index: network.c
===================================================================
RCS file: /cvsroot/xine/xine-ui/src/xitk/network.c,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -r1.68 -r1.69
--- network.c 20 Apr 2006 19:02:13 -0000 1.68
+++ network.c 22 May 2006 17:53:26 -0000 1.69
@@ -551,7 +551,7 @@
/* Each line sent is '\n' terminated */
if(cr) {
if((buf[strlen(buf)] == '\0') && (buf[strlen(buf) - 1] != '\n'))
- sprintf(buf, "%s%c", buf, '\n');
+ strcat(buf, "\n");
}
return _sock_write(socket, buf, strlen(buf));
@@ -747,15 +747,15 @@
while(session_commands[i]->command != NULL) {
if(session_commands[i]->enable) {
if((curpos + maxlen) >= 80) {
- sprintf(buf, "%s\n ", buf);
+ strcat(buf, "\n ");
curpos = 7;
}
- sprintf(buf, "%s%s", buf, session_commands[i]->command);
+ strcat(buf, session_commands[i]->command);
curpos += strlen(session_commands[i]->command);
for(j = 0; j < (maxlen - strlen(session_commands[i]->command)); j++) {
- sprintf(buf, "%s ", buf);
+ strcat(buf, " ");
curpos++;
}
}
@@ -1109,13 +1109,13 @@
int i;
char buf[_BUFSIZ];
- memset(&buf, 0, sizeof(buf));
+ buf[0] = 0;
for(i = 0; i < num_commands; i++) {
- if(strlen(buf))
- sprintf(buf, "%s %s", buf, commands[i]);
+ if(buf[0])
+ sprintf(buf+strlen(buf), " %s", commands[i]);
else
- snprintf(buf, sizeof(buf), "%s", commands[i]);
+ strcpy(buf, commands[i]);
}
client_handle_command(session, buf);
@@ -1663,8 +1663,7 @@
client_info->command.line = (char *) realloc(client_info->command.line, \
strlen(line) + 1);
- memset(client_info->command.line, 0, sizeof(client_info->command.line));
- sprintf(client_info->command.line, "%s", line);
+ strcpy(client_info->command.line, line);
}
}
@@ -1705,16 +1704,15 @@
int i = 0;
char buf[_BUFSIZ];
- memset(&buf, 0, sizeof(buf));
- snprintf(buf, sizeof(buf), "%s", COMMANDS_PREFIX);
+ strcpy(buf, COMMANDS_PREFIX);
while(commands[i].command != NULL) {
if(commands[i].public) {
- sprintf(buf, "%s\t%s", buf, commands[i].command);
+ sprintf(buf+strlen(buf), "\t%s", commands[i].command);
}
i++;
}
- sprintf(buf, "%s.\n", buf);
+ strcat(buf, ".\n");
sock_write(client_info->socket, buf);
}
@@ -1745,22 +1743,22 @@
while(commands[i].command != NULL) {
if(commands[i].public) {
if((curpos + maxlen) >= 80) {
- sprintf(buf, "%s\n ", buf);
+ strcat(buf, "\n ");
curpos = 7;
}
- sprintf(buf, "%s%s", buf, commands[i].command);
+ strcat(buf, commands[i].command);
curpos += strlen(commands[i].command);
for(j = 0; j < (maxlen - strlen(commands[i].command)); j++) {
- sprintf(buf, "%s ", buf);
+ strcat(buf, " ");
curpos++;
}
}
i++;
}
- sprintf(buf, "%s\n", buf);
+ strcat(buf, "\n");
sock_write(client_info->socket, buf);
}
else {
@@ -2088,22 +2086,22 @@
char buf[64];
int status;
- snprintf(buf, sizeof(buf), "%s", "Current status: ");
+ strcpy(buf, "Current status: ");
status = xine_get_status(gGui->stream);
if(status <= XINE_STATUS_QUIT)
- sprintf(buf, "%s%s", buf, status_struct[status].name);
+ strcat(buf, status_struct[status].name);
else
- sprintf(buf, "%s%s", buf, "*UNKNOWN*");
+ strcat(buf, "*UNKNOWN*");
- sprintf(buf, "%s%c", buf, '\n');
+ strcat(buf, "\n");
sock_write(client_info->socket, buf);
}
else if(is_arg_contain(client_info, 1, "speed")) {
char buf[64];
int speed = -1, i;
- snprintf(buf, sizeof(buf), "%s", "Current speed: ");
+ strcpy(buf, "Current speed: ");
speed = xine_get_param(gGui->stream, XINE_PARAM_SPEED);
for(i = 0; speeds_struct[i].name != NULL; i++) {
@@ -2112,11 +2110,11 @@
}
if(i < ((sizeof(speeds_struct) / sizeof(speeds_struct[0])) - 1))
- sprintf(buf, "%s%s", buf, speeds_struct[i].name);
+ strcat(buf, speeds_struct[i].name);
else
- sprintf(buf, "%s%s", buf, "*UNKNOWN*");
+ strcat(buf, "*UNKNOWN*");
- sprintf(buf, "%s%c", buf, '\n');
+ strcat(buf, "\n");
sock_write(client_info->socket, buf);
}
else if(is_arg_contain(client_info, 1, "position")) {
@@ -2150,26 +2148,26 @@
switch(gGui->playlist.loop) {
case PLAYLIST_LOOP_NO_LOOP:
- sprintf(buf, "%s%s", buf, "'No Loop'");
+ strcat(buf, "'No Loop'");
break;
case PLAYLIST_LOOP_LOOP:
- sprintf(buf, "%s%s", buf, "'Loop'");
+ strcat(buf, "'Loop'");
break;
case PLAYLIST_LOOP_REPEAT:
- sprintf(buf, "%s%s", buf, "'Repeat'");
+ strcat(buf, "'Repeat'");
break;
case PLAYLIST_LOOP_SHUFFLE:
- sprintf(buf, "%s%s", buf, "'Shuffle'");
+ strcat(buf, "'Shuffle'");
break;
case PLAYLIST_LOOP_SHUF_PLUS:
- sprintf(buf, "%s%s", buf, "'Shuffle forever'");
+ strcat(buf, "'Shuffle forever'");
break;
default:
- sprintf(buf, "%s%s", buf, "'!!Unknown!!'");
+ strcat(buf, "'!!Unknown!!'");
break;
}
- sprintf(buf, "%s.\n", buf);
+ strcat(buf, ".\n");
sock_write(client_info->socket, buf);
}
}
@@ -2638,11 +2636,11 @@
p++;
if(p)
- snprintf(remaining, sizeof(remaining), "%s", (_atoa(p)));
+ strcpy(remaining, (_atoa(p)));
client_info->command.line = (char *) realloc(client_info->command.line, \
sizeof(char *) * (strlen(c) + 1));
- sprintf(client_info->command.line, "%s", c);
+ strcpy(client_info->command.line, c);
if(p) {
/* remove last ';' */
@@ -2657,7 +2655,7 @@
if(strlen(remaining)) {
client_info->command.remain = (char *) realloc(client_info->command.remain,
sizeof(char *) * (strlen(remaining) + 1));
- sprintf(client_info->command.remain, "%s", remaining);
+ strcpy(client_info->command.remain, remaining);
}
else {
SAFE_FREE(client_info->command.remain);
@@ -2673,7 +2671,7 @@
client_info->command.line = (char *) realloc(client_info->command.line,
sizeof(char *) * (strlen(client_info->command.remain) + 1));
- sprintf(client_info->command.line, "%s", client_info->command.remain);
+ strcpy(client_info->command.line, client_info->command.remain);
SAFE_FREE(client_info->command.remain);
}
@@ -2768,7 +2766,7 @@
if((*(pcmd - 1) != '\\') && (get_quote == 0)) {
__end_args:
- sprintf(client_info->command.args[nargs], "%s", _atoa(buf));
+ strcpy(client_info->command.args[nargs], _atoa(buf));
nargs++;
memset(&buf, 0, sizeof(buf));
pb = buf;
@@ -2794,8 +2792,7 @@
else {
client_info->command.command = (char *) realloc(client_info->command.command, \
strlen(client_info->command.line) + 1);
- memset(client_info->command.command, 0, sizeof(client_info->command.command));
- sprintf(client_info->command.command, "%s", client_info->command.line);
+ strcpy(client_info->command.command, client_info->command.line);
}
#if 0
Index: osd.c
===================================================================
RCS file: /cvsroot/xine/xine-ui/src/xitk/osd.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- osd.c 7 Aug 2005 22:22:18 -0000 1.35
+++ osd.c 22 May 2006 17:53:26 -0000 1.36
@@ -372,40 +372,38 @@
y += h;
}
- memset(&buffer, 0, sizeof(buffer));
-
- snprintf(buffer, sizeof(buffer), "%s", _("Audio: "));
+ strcpy(buffer, _("Audio: "));
len = strlen(buffer);
switch(audiochannel) {
case -2:
- sprintf(buffer, "%s%s", buffer, "off");
+ strcat(buffer, "off");
break;
case -1:
if(!xine_get_audio_lang (gGui->stream, audiochannel, &buffer[len]))
- sprintf(buffer, "%s%s", buffer, "auto");
+ strcat(buffer, "auto");
break;
default:
if(!xine_get_audio_lang (gGui->stream, audiochannel, &buffer[len]))
- sprintf(buffer, "%s%3d", buffer, audiochannel);
+ sprintf(buffer+strlen(buffer), "%3d", audiochannel);
break;
}
- sprintf(buffer, "%s%s", buffer, ", Spu: ");
+ strcat(buffer, ", Spu: ");
len = strlen(buffer);
switch (spuchannel) {
case -2:
- sprintf(buffer, "%s%s", buffer, "off");
+ strcat(buffer, "off");
break;
case -1:
if(!xine_get_spu_lang (gGui->stream, spuchannel, &buffer[len]))
- sprintf(buffer, "%s%s", buffer, "auto");
+ strcat(buffer, "auto");
break;
default:
if(!xine_get_spu_lang (gGui->stream, spuchannel, &buffer[len]))
- sprintf(buffer, "%s%3d", buffer, spuchannel);
+ sprintf(buffer+strlen(buffer), "%3d", spuchannel);
break;
}
- sprintf(buffer, "%s.", buffer);
+ strcat(buffer, ".");
xine_osd_draw_text(gGui->osd.sinfo.osd[0], x, y, buffer, XINE_OSD_TEXT1);
xine_osd_get_text_size(gGui->osd.sinfo.osd[0], buffer, &w, &h);
if(w > osdw)
@@ -424,12 +422,12 @@
int totaldays;
totaldays = totaltime / (3600 * 24);
- sprintf(buffer, "%s(%.0f%%) %s ", buffer, ((float)playedtime / \
(float)totaltime) * 100, _("of")); + sprintf(buffer+strlen(buffer), "(%.0f%%) %s \
", ((float)playedtime / (float)totaltime) * 100, _("of"));
if(totaldays > 0)
- sprintf(buffer, "%s%d::%02d", buffer, totaldays, totaltime / 3600);
+ sprintf(buffer+strlen(buffer), "%d::%02d", totaldays, totaltime / 3600);
else
- sprintf(buffer, "%s%d:%02d:%02d", buffer, totaltime / 3600, (totaltime % 3600) / \
60, totaltime % 60); + sprintf(buffer+strlen(buffer), "%d:%02d:%02d", totaltime / \
3600, (totaltime % 3600) / 60, totaltime % 60); }
xine_osd_draw_text(gGui->osd.sinfo.osd[0], x, y, buffer, XINE_OSD_TEXT1);
Index: stream_infos.c
===================================================================
RCS file: /cvsroot/xine/xine-ui/src/xitk/stream_infos.c,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -r1.42 -r1.43
--- stream_infos.c 15 Dec 2004 21:10:46 -0000 1.42
+++ stream_infos.c 22 May 2006 17:53:26 -0000 1.43
@@ -260,16 +260,16 @@
len += strlen(aalbum) + 3;
ident = (char *) xine_xmalloc(len + 1);
- sprintf(ident, "%s", atitle);
+ strcpy(ident, atitle);
if((aartist && strlen(aartist)) || (aalbum && strlen(aalbum))) {
strcat(ident, " (");
if(aartist && strlen(aartist))
- sprintf(ident, "%s%s", ident, aartist);
+ strcat(ident, aartist);
if((aartist && strlen(aartist)) && (aalbum && strlen(aalbum)))
strcat(ident, " - ");
if(aalbum && strlen(aalbum))
- sprintf(ident, "%s%s", ident, aalbum);
+ strcat(ident, aalbum);
strcat(ident, ")");
}
}
Index: viewlog.c
===================================================================
RCS file: /cvsroot/xine/xine-ui/src/xitk/viewlog.c,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -r1.51 -r1.52
--- viewlog.c 15 Dec 2004 21:10:46 -0000 1.51
+++ viewlog.c 22 May 2006 17:53:26 -0000 1.52
@@ -229,7 +229,7 @@
break;
default:
- sprintf(buf, "%s%c", buf, *p);
+ sprintf(buf+strlen(buf), "%c", *p);
break;
}
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Xine-cvslog mailing list
Xine-cvslog@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xine-cvslog
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic