Fix compilation warnings in muttlib.c
authorJulien Danjou <julien@danjou.info>
Tue, 7 Nov 2006 17:31:10 +0000 (18:31 +0100)
committerPierre Habouzit <madcoder@debian.org>
Tue, 7 Nov 2006 17:49:53 +0000 (18:49 +0100)
Change some size_t into ssize_t

Signed-off-by: Julien Danjou <julien@danjou.info>
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
muttlib.c
protos.h

index c5be0b7..a9d58e9 100644 (file)
--- a/muttlib.c
+++ b/muttlib.c
@@ -408,10 +408,10 @@ char *_mutt_expand_path (char *s, size_t slen, int rx)
  * name.
  */
 
-char *mutt_gecos_name (char *dest, size_t destlen, struct passwd *pw)
+char *mutt_gecos_name (char *dest, ssize_t destlen, struct passwd *pw)
 {
   regmatch_t pat_match[1];
-  size_t pwnl;
+  ssize_t pwnl;
   int idx;
   char *p;
 
@@ -853,7 +853,7 @@ int mutt_skipchars (const char *s, const char *c)
 }
 
 void mutt_FormatString (char *dest,     /* output buffer */
-                        size_t destlen, /* output buffer len */
+                        ssize_t destlen, /* output buffer len */
                         const char *src,        /* template string */
                         format_t * callback,    /* callback for processing */
                         unsigned long data,     /* callback data */
@@ -861,7 +861,7 @@ void mutt_FormatString (char *dest,     /* output buffer */
 {                               /* callback flags */
   char prefix[SHORT_STRING], buf[LONG_STRING], *cp, *wptr = dest, ch;
   char ifstring[SHORT_STRING], elsestring[SHORT_STRING];
-  size_t wlen, count, len, col, wid;
+  ssize_t wlen, wid, count, col, len;
 
   prefix[0] = '\0';
   destlen--;                    /* save room for the terminal \0 */
@@ -888,7 +888,7 @@ void mutt_FormatString (char *dest,     /* output buffer */
         /* eat the format string */
         cp = prefix;
         count = 0;
-        while (count < sizeof (prefix) &&
+        while (count < ssizeof (prefix) &&
                (isdigit ((unsigned char) *src) || *src == '.' || *src == '-'))
         {
           *cp++ = *src++;
@@ -910,7 +910,7 @@ void mutt_FormatString (char *dest,     /* output buffer */
         /* eat the `if' part of the string */
         cp = ifstring;
         count = 0;
-        while (count < sizeof (ifstring) && *src && *src != '?'
+        while (count < ssizeof (ifstring) && *src && *src != '?'
                && *src != '&') {
           *cp++ = *src++;
           count++;
@@ -922,7 +922,7 @@ void mutt_FormatString (char *dest,     /* output buffer */
           src++;                /* skip the & */
         cp = elsestring;
         count = 0;
-        while (count < sizeof (elsestring) && *src && *src != '?') {
+        while (count < ssizeof (elsestring) && *src && *src != '?') {
           *cp++ = *src++;
           count++;
         }
index 1f1e206..ee55845 100644 (file)
--- a/protos.h
+++ b/protos.h
@@ -37,7 +37,7 @@ typedef const char *format_t (char *, size_t, char, const char *,
                               const char *, const char *, const char *,
                               unsigned long, format_flag);
 
-void mutt_FormatString (char *, size_t, const char *, format_t *,
+void mutt_FormatString (char *, ssize_t, const char *, format_t *,
                         unsigned long, format_flag);
 void mutt_generate_boundary (PARAMETER **);
 void mutt_delete_parameter (const char *attribute, PARAMETER ** p);
@@ -83,7 +83,7 @@ char *mutt_iconv_hook (const char *);
 char *mutt_expand_path (char *, size_t);
 char *_mutt_expand_path (char *, size_t, int);
 char *mutt_find_hook (int, const char *);
-char *mutt_gecos_name (char *, size_t, struct passwd *);
+char *mutt_gecos_name (char *, ssize_t, struct passwd *);
 char *mutt_gen_msgid (void);
 char *mutt_get_body_charset (char *, size_t, BODY *);
 const char *mutt_get_name (address_t *);