aboutsummaryrefslogtreecommitdiffstats
path: root/tests/ui-tests/message-browser.c
diff options
context:
space:
mode:
authorMatthew Loper <mloper@src.gnome.org>2000-02-22 10:35:12 +0800
committerMatthew Loper <mloper@src.gnome.org>2000-02-22 10:35:12 +0800
commitbd67bc15f300f5bcd8d220646af7b5ad3dd9d4b6 (patch)
treeb9444e2354ceb5c0a126d409eec84b9ae6ef9816 /tests/ui-tests/message-browser.c
parent672951d588040b56f0a732899b80ba67827bc8ba (diff)
downloadgsoc2013-evolution-bd67bc15f300f5bcd8d220646af7b5ad3dd9d4b6.tar.gz
gsoc2013-evolution-bd67bc15f300f5bcd8d220646af7b5ad3dd9d4b6.tar.zst
gsoc2013-evolution-bd67bc15f300f5bcd8d220646af7b5ad3dd9d4b6.zip
+ * tests/ui-tests/message-browser.c (on_link_clicked): stop
+ sscanf() abuse. svn path=/trunk/; revision=1898
Diffstat (limited to 'tests/ui-tests/message-browser.c')
-rw-r--r--tests/ui-tests/message-browser.c50
1 files changed, 27 insertions, 23 deletions
diff --git a/tests/ui-tests/message-browser.c b/tests/ui-tests/message-browser.c
index 328cde3bcf..fbd0550571 100644
--- a/tests/ui-tests/message-browser.c
+++ b/tests/ui-tests/message-browser.c
@@ -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);
-
-
}