mime_decode_*() functions can return -1 for error, which would be lost when assigning to unsigned int.
Sprinkled ssize_t across function return types and result variables.
/* just dump MIME part without any decoding */
/* just dump MIME part without any decoding */
-static int mime_decode_asis(FILE* in, FILE* out, uschar* boundary)
+static ssize_t
+mime_decode_asis(FILE* in, FILE* out, uschar* boundary)
uschar buffer[MIME_MAX_LINE_LENGTH];
while(fgets(CS buffer, MIME_MAX_LINE_LENGTH, mime_stream) != NULL) {
uschar buffer[MIME_MAX_LINE_LENGTH];
while(fgets(CS buffer, MIME_MAX_LINE_LENGTH, mime_stream) != NULL) {
/* decode base64 MIME part */
/* decode base64 MIME part */
-static int mime_decode_base64(FILE* in, FILE* out, uschar* boundary)
+static ssize_t
+mime_decode_base64(FILE* in, FILE* out, uschar* boundary)
{
uschar ibuf[MIME_MAX_LINE_LENGTH], obuf[MIME_MAX_LINE_LENGTH];
uschar *ipos, *opos;
{
uschar ibuf[MIME_MAX_LINE_LENGTH], obuf[MIME_MAX_LINE_LENGTH];
uschar *ipos, *opos;
int bytestate = 0;
opos = obuf;
int bytestate = 0;
opos = obuf;
/* decode quoted-printable MIME part */
/* decode quoted-printable MIME part */
-static int mime_decode_qp(FILE* in, FILE* out, uschar* boundary)
+static ssize_t
+mime_decode_qp(FILE* in, FILE* out, uschar* boundary)
{
uschar ibuf[MIME_MAX_LINE_LENGTH], obuf[MIME_MAX_LINE_LENGTH];
uschar *ipos, *opos;
{
uschar ibuf[MIME_MAX_LINE_LENGTH], obuf[MIME_MAX_LINE_LENGTH];
uschar *ipos, *opos;
while (fgets(CS ibuf, MIME_MAX_LINE_LENGTH, in) != NULL)
{
while (fgets(CS ibuf, MIME_MAX_LINE_LENGTH, in) != NULL)
{
uschar decode_path[1024];
FILE *decode_file = NULL;
long f_pos = 0;
uschar decode_path[1024];
FILE *decode_file = NULL;
long f_pos = 0;
- unsigned int size_counter = 0;
- int (*decode_function)(FILE*, FILE*, uschar*);
+ ssize_t size_counter = 0;
+ ssize_t (*decode_function)(FILE*, FILE*, uschar*);
if (mime_stream == NULL)
return FAIL;
if (mime_stream == NULL)
return FAIL;