balsa r7972 - in trunk: . libbalsa
- From: PeterB svn gnome org
- To: svn-commits-list gnome org
- Subject: balsa r7972 - in trunk: . libbalsa
- Date: Sun, 14 Sep 2008 23:48:06 +0000 (UTC)
Author: PeterB
Date: Sun Sep 14 23:48:05 2008
New Revision: 7972
URL: http://svn.gnome.org/viewvc/balsa?rev=7972&view=rev
Log:
better debugging
Modified:
trunk/ChangeLog
trunk/libbalsa/mailbox_mbox.c
Modified: trunk/libbalsa/mailbox_mbox.c
==============================================================================
--- trunk/libbalsa/mailbox_mbox.c (original)
+++ trunk/libbalsa/mailbox_mbox.c Sun Sep 14 23:48:05 2008
@@ -249,16 +249,18 @@
lbm_mbox_stream_seek_to_message(GMimeStream * stream, off_t offset)
{
char buffer[5];
+ ssize_t nread = 0;
gboolean retval;
retval = g_mime_stream_seek(stream, offset, GMIME_STREAM_SEEK_SET) >= 0
- && g_mime_stream_read(stream, buffer, sizeof buffer) == sizeof buffer
+ && (nread = g_mime_stream_read(stream, buffer, sizeof buffer))
+ == sizeof buffer
&& strncmp("From ", buffer, 5) == 0;
#if DEBUG_SEEK
if (!retval) {
- buffer[4] = 0;
- g_print("%s at %ld failed: saw \"%s\"\n", __func__, offset,
- buffer);
+ buffer[nread] = 0;
+ g_print("%s at %ld failed: read %d, saw \"%s\"\n", __func__, offset,
+ nread, buffer);
}
#endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]