$OpenBSD$
--- SoObjects/Mailer/SOGoDraftObject.m.orig	Fri Mar  9 19:19:24 2012
+++ SoObjects/Mailer/SOGoDraftObject.m	Mon Mar 19 19:56:47 2012
@@ -114,7 +114,8 @@ static NSString *headerKeys[] = {@"subject", @"to", @"
 		    range: (NSRange) theRange
 {
   const char *b, *bytes;
-  int i, len, slen;
+  int slen;
+  NSUInteger i, len;
   
   if (!theCString)
     {
@@ -571,24 +572,25 @@ static NSString    *userAgent      = nil;
   NSEnumerator *allRecipients;
   NSString *currentRecipient;
   NGImap4EnvelopeAddress *currentAddress;
-  int count, max;
+  NSUInteger count, max;
 
   max = [addresses count];
 
   allRecipients = [recipients objectEnumerator];
   while (max > 0
-	 && ((currentRecipient = [allRecipients nextObject])))
-    for (count = max - 1; count >= 0; count--)
+	 && ((currentRecipient = [allRecipients nextObject]))) {
+    for (count = max ; count > 0; count--)
       {
-	currentAddress = [addresses objectAtIndex: count];
+	currentAddress = [addresses objectAtIndex: count - 1];
 	if ([currentRecipient
               caseInsensitiveCompare: [currentAddress baseEMail]]
             == NSOrderedSame)
 	  {
-	    [addresses removeObjectAtIndex: count];
+	    [addresses removeObjectAtIndex: count - 1];
 	    max--;
 	  }
       }
+      }
 }
 
 - (void) _fillInReplyAddresses: (NSMutableDictionary *) _info
@@ -695,7 +697,7 @@ static NSString    *userAgent      = nil;
 - (void) _fetchAttachments: (NSArray *) parts
                   fromMail: (SOGoMailObject *) sourceMail
 {
-  unsigned int count, max;
+  NSUInteger count, max;
   NSArray *paths, *bodies;
   NSData *body;
   NSDictionary *currentInfo;
@@ -861,7 +863,7 @@ static NSString    *userAgent      = nil;
   NSMutableArray *ma;
   NSFileManager *fm;
   NSArray *files;
-  unsigned count, max;
+  NSUInteger count, max;
   NSString *filename;
 
   fm = [NSFileManager defaultManager];
@@ -1210,7 +1212,7 @@ static NSString    *userAgent      = nil;
 {
   /* returns nil on error */
   NSArray  *names;
-  unsigned i, count;
+  NSUInteger i, count;
   NGMimeBodyPart *bodyPart;
   NSMutableArray *bodyParts;
 
@@ -1293,7 +1295,7 @@ static NSString    *userAgent      = nil;
 - (NSString *) _quoteSpecials: (NSString *) address
 {
   NSString *result, *part, *s2;
-  int i, len;
+  NSUInteger i, len;
 
   // We want to correctly send mails to recipients such as :
   // foo.bar
@@ -1342,7 +1344,7 @@ static NSString    *userAgent      = nil;
 {
   NSMutableArray *result;
   NSString *address;
-  int count, max;
+  NSUInteger count, max;
 
   max = [addresses count];
   result = [NSMutableArray arrayWithCapacity: max];
$OpenBSD$
--- UI/MailPartViewers/UIxMailPartAlternativeViewer.m.orig	Tue Feb 14 22:31:30 2012
+++ UI/MailPartViewers/UIxMailPartAlternativeViewer.m	Fri Mar  9 18:29:19 2012
@@ -21,6 +21,7 @@
 */
 
 #import <Foundation/NSNull.h>
+#import <Foundation/NSValue.h>
 
 #import <NGExtensions/NSObject+Logs.h>
 
@@ -43,7 +44,7 @@
 @interface UIxMailPartAlternativeViewer : UIxMailPartViewer
 {
   id           childInfo;
-  unsigned int childIndex;
+  NSUInteger   childIndex;
 }
 
 @end
@@ -89,10 +90,10 @@
   return types;
 }
 
-- (unsigned int) _preferredTypesPart: (NSArray *) types
+- (NSUInteger) _preferredTypesPart: (NSArray *) types
 {
-  unsigned int count, max;
-  unsigned int part;
+  NSUInteger count, max;
+  NSUInteger part;
   const NSString *priorities[] = { @"multipart/related", @"multipart/mixed",
 				   @"text/calendar", @"text/html",
 				   @"text/plain" };
@@ -113,7 +114,7 @@
 - (int) _selectPartIndexFromTypes: (NSArray *) _types
 {
   /* returns the index of the selected part or NSNotFound */
-  unsigned count, max, part;
+  NSUInteger count, max, part;
 
   part = [self _preferredTypesPart: _types];
   if (part == NSNotFound)
@@ -136,7 +137,7 @@
 
 - (void) selectChildInfo
 {
-  unsigned idx;
+  NSUInteger idx;
 
   [childInfo release]; childInfo = nil;
   childIndex = 0;
@@ -164,7 +165,7 @@
   return childInfo;
 }
 
-- (unsigned int) childIndex
+- (NSUInteger) childIndex
 {
   if (!childIndex)
     [self selectChildInfo];
@@ -174,11 +175,9 @@
 
 - (NSString *) childPartName
 {
-  char buf[8];
+  NSNumber *part = [NSNumber numberWithUnsignedInteger: [self childIndex] +1];
 
-  sprintf (buf, "%d", [self childIndex] + 1);
-
-  return [NSString stringWithCString:buf];
+  return [part stringValue];
 }
 
 - (id) childPartPath
$OpenBSD$
--- UI/MailerUI/UIxMailMainFrame.m.orig	Fri Mar  9 17:40:27 2012
+++ UI/MailerUI/UIxMailMainFrame.m	Fri Mar  9 17:40:53 2012
@@ -549,7 +549,7 @@
   NSArray *available;
   NSDictionary *metaData;
   SOGoUserDefaults *ud;
-  unsigned int i;
+  NSUInteger i;
 
   if (!columnsOrder)
     {
$OpenBSD$
--- UI/MailerUI/UIxMailMainFrame.h.orig	Fri Mar  9 17:39:55 2012
+++ UI/MailerUI/UIxMailMainFrame.h	Fri Mar  9 17:40:06 2012
@@ -31,7 +31,7 @@
   NSMutableDictionary *moduleSettings;
 
   NSArray *columnsOrder;
-  int folderType;
+  NSInteger folderType;
   NSDictionary *currentColumn;
 }
 
