aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-folder-summary.c
diff options
context:
space:
mode:
authorNotZed <NotZed@HelixCode.com>2000-05-06 02:58:05 +0800
committerMichael Zucci <zucchi@src.gnome.org>2000-05-06 02:58:05 +0800
commit659c7faac5e09acd919c2e9c596da27a962b2ed2 (patch)
treef3e68f879e1e1a867a76220328f2f61356ba7e25 /camel/camel-folder-summary.c
parent52051385f2d802b982fa7427f7277609332cccb6 (diff)
downloadgsoc2013-evolution-659c7faac5e09acd919c2e9c596da27a962b2ed2.tar.gz
gsoc2013-evolution-659c7faac5e09acd919c2e9c596da27a962b2ed2.tar.zst
gsoc2013-evolution-659c7faac5e09acd919c2e9c596da27a962b2ed2.zip
And same here ... (camel_folder_summary_encode_fixed_int32): Ugh, fwrite
2000-05-05 NotZed <NotZed@HelixCode.com> * camel-folder-summary.c: And same here ... (camel_folder_summary_encode_fixed_int32): Ugh, fwrite doesn't return -1 on error .. (camel_folder_summary_decode_fixed_int32): Neither deos fread. (camel_folder_summary_encode_token): Fix here too. svn path=/trunk/; revision=2819
Diffstat (limited to 'camel/camel-folder-summary.c')
-rw-r--r--camel/camel-folder-summary.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/camel/camel-folder-summary.c b/camel/camel-folder-summary.c
index 0879d0fc37..ee879b3f7f 100644
--- a/camel/camel-folder-summary.c
+++ b/camel/camel-folder-summary.c
@@ -23,6 +23,7 @@
#include <netinet/in.h>
#include <ctype.h>
#include <string.h>
+#include <errno.h>
#include "camel-folder-summary.h"
@@ -468,7 +469,9 @@ camel_folder_summary_encode_fixed_int32(FILE *out, gint32 value)
guint32 save;
save = htonl(value);
- return fwrite(&save, sizeof(save), 1, out);
+ if (fwrite(&save, sizeof(save), 1, out) != 1)
+ return -1;
+ return 0;
}
int
@@ -476,7 +479,7 @@ camel_folder_summary_decode_fixed_int32(FILE *in, gint32 *dest)
{
guint32 save;
- if (fread(&save, sizeof(save), 1, in) != -1) {
+ if (fread(&save, sizeof(save), 1, in) == 1) {
*dest = ntohl(save);
return 0;
} else {
@@ -549,7 +552,8 @@ camel_folder_summary_encode_token(FILE *out, char *str)
} else {
if (camel_folder_summary_encode_uint32(out, len+32) == -1)
return -1;
- return fwrite(str, len, 1, out);
+ if (fwrite(str, len, 1, out) != 1)
+ return -1;
}
}
return 0;
@@ -583,7 +587,7 @@ camel_folder_summary_decode_token(FILE *in, char **str)
} else {
len -= 32;
ret = g_malloc(len+1);
- if (fread(ret, len, 1, in) == -1) {
+ if (fread(ret, len, 1, in) != 1) {
g_free(ret);
*str = NULL;
return -1;
@@ -606,7 +610,9 @@ camel_folder_summary_encode_string(FILE *out, char *str)
len = strlen(str);
if (camel_folder_summary_encode_uint32(out, len+1) == -1)
return -1;
- return fwrite(str, len, 1, out);
+ if (fwrite(str, len, 1, out) == 1)
+ return 0;
+ return -1;
}
@@ -628,7 +634,7 @@ camel_folder_summary_decode_string(FILE *in, char **str)
}
ret = g_malloc(len+1);
- if (fread(ret, len, 1, in) == -1) {
+ if (fread(ret, len, 1, in) != 1) {
g_free(ret);
*str = NULL;
return -1;
@@ -1045,7 +1051,6 @@ int main(int argc, char **argv)
CamelFolderSummary *s;
char *buffer;
int len;
- extern int strdup_count, malloc_count, free_count;
ibex *index;
gtk_init(&argc, &argv);
@@ -1095,6 +1100,10 @@ int main(int argc, char **argv)
}
}
+ printf("Saivng summary\n");
+ camel_folder_summary_set_filename(s, "index.summary");
+ camel_folder_summary_save(s);
+
gtk_object_unref(mp);
gtk_object_unref(s);
an class='insertions'>+3 * The KDE FreeBSD team is proud to announce the release of KDE 4.2.2miwi2009-04-022-7/+3 * Update KDE to 4.2.1.makc2009-03-091-3/+3 * The KDE FreeBSD team is proud to announce the release of KDE 4.2.0miwi2009-02-095-290/+275 * The KDE FreeBSD team is proud to announce the releasemiwi2008-08-292-6/+6 * The KDE FreeBSD team is proud to announce the releasemiwi2008-08-182-6/+6 * PHP Documentation in these language has been removed from the distribution.edwin2008-08-042-14/+0 * - Update WWW sitenivit2008-07-291-1/+1 * Bump portrevision due to upgrade of devel/gettext.edwin2008-06-062-1/+2 * Removal of arabic/katoobedwin2008-04-309-129/+0 * - Remove unneeded dependency from gtk12/gtk20 [1]miwi2008-04-2010-35/+34 * - Remove USE_XLIB/USE_X_PREFIX/USE_XPM in favor of USE_XORGmiwi2008-03-261-2/+1 * - Remove USE_XLIB/USE_X_PREFIX/USE_XPM in favor of USE_XORGmiwi2008-03-251-2/+1 * - Remove USE_GETOPT_LONG which is a no-op since March 2007pav2008-03-201-1/+0 * Fix distfile location for outdated koffice-l10ns.lofi2007-11-091-1/+1 * Update to KDE 3.5.8lofi2007-10-304-8/+6 * Presenting GNOME 2.20.1 and all related works for FreeBSD. The officialmarcus2007-10-252-13/+14 * Revert more PORTREVISION accidentslofi2007-07-051-0/+1 * Update to KDE 3.5.7 / KOffice 1.6.3lofi2007-07-047-11/+286 * BROKEN with gcc 4.2kris2007-05-271-0/+4 * - Welcome X.org 7.2 \o/.flz2007-05-2010-3/+9 * Release maintainerships.thierry2007-03-161-1/+1 * Update to KDE 3.5.6 / KOffice 1.6.2lofi2007-03-142-6/+6 * Update maintainer's email address.linimon2007-03-076-6/+6 * Really normalize Aspell dictionaries ports PKGVERSION...thierry2007-02-151-0/+1 * Add Aspell Arabic dictionaries.thierry2007-02-13ution/commit/?h=BALSA_1_3_5&id=01489fa6b4e60ee6c245edb6e2d2d83f8ac3918d'>Add some includesJP Rosevear2001-06-222-0/+8 * Temporarily remove the Bcc header before sending the message.Jeffrey Stedfast2001-06-222-6/+23 * add include pathJP Rosevear2001-06-222-0/+4 * remove buttons and use evolution's standard ui configJP Rosevear2001-06-222-21/+18 * print description textJP Rosevear2001-06-222-41/+29 * add toolbarJP Rosevear2001-06-222-1/+24 * Fixed .gif problemKevin Breit2001-06-228-24/+26 * Specify the file formatKevin Breit2001-06-224-4/+14 * Trying to fix the .gif problemKevin Breit2001-06-224-22/+40 * New function that decides if 2 word types are mergeable. An atom and aJeffrey Stedfast2001-06-223-30/+59 * Redid graphics to add labels to them and described the labels in text.Kevin Breit2001-06-228-0/+80 * calendar/cal-client/Makefile.am: calendar/cal-util/Makefile.am:Peter Williams2001-06-2212-856/+1570 * Renamed. (The old name, edit_contact_info_have_book_cb was a hold-overJon Trowbridge2001-06-225-52/+170 * Remove empty "name" property setting from the popup control.Jon Trowbridge2001-06-222-1/+5 * Emit the POSTPONE signal if we are offline. (setup_ui): If we are offline,Jeffrey Stedfast2001-06-222-13/+34 * Oops, small fix.Jacob Leach2001-06-221-1/+1 * Added config-encryption.sgml for buildingKevin Breit2001-06-226-0/+300 * Added const to 'in' parametersRodrigo Moya2001-06-221-3/+3 * Updated graphics for newer UI.Kevin Breit2001-06-2224-0/+8 * added libwombat to LDADDRodrigo Moya2001-06-222-0/+5 * create a WombatClient when creating a CalClient object, so that we canRodrigo Moya2001-06-227-1/+184 * Use camel_address_length() rather than casting and accessing data members.Jeffrey Stedfast2001-06-222-3/+9 * Redid graphics to add labels to them and described in labels in text.Kevin Breit2001-06-2220-40/+216 * Allow the message to be sent even if there are no To recipients but onlyJeffrey Stedfast2001-06-222-9/+26 * Fix bug #3409: Removing an EvolutionStorage from the shell's folderJacob Leach2001-06-225-19/+99 * added new directory for the libwombat library, which will contain theRodrigo Moya2001-06-213-0/+20 * created new directory for the libwombat libraryRodrigo Moya2001-06-215-0/+283 * added new interface (WombatClient)Rodrigo Moya2001-06-212-0/+9 * fix to include the CFLAGS for extra librariesHavoc Pennington2001-06-212-0/+6 * Added fileKevin Breit2001-06-214-18/+320 * Moved my entires to doc/ChangeLog per request of danwKevin Breit2001-06-215-85/+114 * Fix the OpenLDAP check to default to "no" if you don't specify anything.Dan Winship2001-06-212-12/+22 * fix a refcounting memleak.Chris Toshok2001-06-212-3/+12 * fix memory leak.Chris Toshok2001-06-212-1/+7 * add prototype for close_dialog to remove warnings.Chris Toshok2001-06-213-0/+7 * Save the formatting preference for this message draft using aJeffrey Stedfast2001-06-212-14/+46 * If the first char of the mailing-list name is '<', chop it off to makeJeffrey Stedfast2001-06-212-6/+19 * Updated for new UI.Kevin Breit2001-06-213-60/+40 * Updated for a newer UI (need to update at a later date.Kevin Breit2001-06-212-104/+68 * removed conflict marker.Dave Camp2001-06-211-1/+0 * Changed attachData to accept a sequence of chars rather than a string.Dave Camp2001-06-217-8/+40 * Make less monotone soundingKevin Breit2001-06-214-14/+10 * Added more postscript descriptionKevin Breit2001-06-212-6/+6 * Reworded a little bit for more descrip.Kevin Breit2001-06-213-4/+10 * Documented categorizing an event.Kevin Breit2001-06-213-4/+78 * print menu command (print_preview_cmd): ditto for print previewJP Rosevear2001-06-218-6/+526 * collapse print commands hereJP Rosevear2001-06-214-51/+20 * send the value to e_table_model_set_value_at as a string as inMikael Hallendal2001-06-201-2/+12 * Updated Bcc: exampleKevin Breit2001-06-203-2/+10 * Change --enable-ldap to --with-openldap, allow a path prefix as anDan Winship2001-06-202-31/+52 * added getFreeBusy methodRodrigo Moya2001-06-209-0/+327 * Took out a reference to gloss.Kevin Breit2001-06-203-0/+24 * Made it build.Kevin Breit2001-06-203-2/+6 * Checked for validity.Aaron Weber2001-06-202-2/+14 * Fix typo. s/Cancel then meeting/ Cancel the meeting/.Kjartan Maraas2001-06-202-1/+6 * More than on accel key is a tad confusing.Kjartan Maraas2001-06-202-1/+6 * Updated Polish translationChyla Zbigniew2001-06-202-339/+285 * For Mendel Mobach <mendel@mobach.nl> :Almer S. Tigelaar2001-06-202-4620/+3198 * moved the function to check for a default timezone to calendar-config.c,Damon Chaplin2001-06-208-66/+98 * added code to show the timezone dialog if the user hasn't set a defaultDamon Chaplin2001-06-206-2/+78 * if the timezones of the start and end of the event are the same, then ifDamon Chaplin2001-06-202-0/+63 * removed stuff to get builtin timezone info from the server.Damon Chaplin2001-06-205-168/+22 * added a 'Time zone' setting. Also rearranged a little, adding a newDamon Chaplin2001-06-2013-346/+327 * split out commands from toolitems/menuitems.Chris Toshok2001-06-202-29/+55 * remove dead fileJP Rosevear2001-06-202-1/+5 * track change to e_addressbook_show_contact_editor signature.Chris Toshok2001-06-2011-98/+82 * rename ce_book_found_fields to this, remove the fetching of fields (theChris Toshok2001-06-20