+ * tests/ui-tests/message-browser.c (on_link_clicked): stop
+ sscanf() abuse. svn path=/trunk/; revision=1898
This commit is contained in:
@ -1,5 +1,8 @@
|
||||
2000-02-21 Matt Loper <matt@helixcode.com>
|
||||
|
||||
* tests/ui-tests/message-browser.c (on_link_clicked): stop
|
||||
sscanf() abuse.
|
||||
|
||||
* tests/Makefile.am: changed references to libibex.a to
|
||||
libibex.la.
|
||||
|
||||
|
||||
@ -261,39 +261,43 @@ on_link_clicked (GtkHTML *html, const gchar *url, gpointer data)
|
||||
gchar tmp_buffer[4096];
|
||||
gint nb_bytes_read;
|
||||
|
||||
gchar* message = g_strdup_printf ("You have clicked on this link:\n%s",
|
||||
url);
|
||||
sscanf (url, "camel://%p", &stream);
|
||||
save_stream = camel_stream_fs_new_with_name ("saved-file", CAMEL_STREAM_FS_WRITE);
|
||||
gchar* message =
|
||||
g_strdup_printf ("You have clicked on this link:\n%s", url);
|
||||
|
||||
if (sscanf (url, "camel://%p", &stream))
|
||||
{
|
||||
save_stream =
|
||||
camel_stream_fs_new_with_name ("saved-file",
|
||||
CAMEL_STREAM_FS_WRITE);
|
||||
|
||||
|
||||
do {
|
||||
|
||||
/* read next chunk of text */
|
||||
nb_bytes_read = camel_stream_read (stream,
|
||||
tmp_buffer,
|
||||
4096);
|
||||
|
||||
/* If there's any text, write it to the stream */
|
||||
if (nb_bytes_read > 0) {
|
||||
camel_stream_write (save_stream, tmp_buffer, nb_bytes_read);
|
||||
|
||||
}
|
||||
do {
|
||||
|
||||
/* read next chunk of text */
|
||||
nb_bytes_read = camel_stream_read (stream,
|
||||
tmp_buffer,
|
||||
4096);
|
||||
|
||||
/* If there's any text, write it to the stream */
|
||||
if (nb_bytes_read > 0) {
|
||||
camel_stream_write (save_stream,
|
||||
tmp_buffer,
|
||||
nb_bytes_read);
|
||||
}
|
||||
|
||||
|
||||
} while (!camel_stream_eos (stream));
|
||||
|
||||
} while (!camel_stream_eos (stream));
|
||||
|
||||
camel_stream_close (save_stream);
|
||||
|
||||
camel_stream_close (save_stream);
|
||||
}
|
||||
|
||||
message_box = gnome_message_box_new (message,
|
||||
GNOME_MESSAGE_BOX_INFO,
|
||||
"Okay", NULL);
|
||||
|
||||
gnome_dialog_set_default (GNOME_DIALOG (message_box), 1);
|
||||
gnome_dialog_run (message_box);
|
||||
gnome_dialog_run (GNOME_DIALOG (message_box));
|
||||
g_free (message);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user