chiark / gitweb /
disorder.h: more consistent approach to function attributes
[disorder] / lib / mime.c
index 9cc54d64fc9c9e382b586a6f5629661d19685f86..00a3c7209377c5e7afa43c6da631a280af3dc936 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * This file is part of DisOrder
- * Copyright (C) 2005, 2007, 2008 Richard Kettlewell
+ * Copyright (C) 2005, 2007-10, 2013 Richard Kettlewell
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -30,6 +30,7 @@
 #include "log.h"
 #include "base64.h"
 #include "kvp.h"
+#include "printf.h"
 
 /** @brief Match whitespace characters */
 static int whitespace(int c) {
@@ -110,7 +111,7 @@ static const char *skipwhite(const char *s, int rfc822_comments) {
   int c, depth;
   
   for(;;) {
-    switch(c = *s) {
+    switch(*s) {
     case ' ':
     case '\t':
     case '\r':
@@ -402,7 +403,7 @@ int mime_multipart(const char *s,
  * @param s Start of field
  * @param dispositionp Where to store disposition
  * @param parameternamep Where to store parameter name
- * @param parametervaluep Wher to store parameter value
+ * @param parametervaluep Where to store parameter value
  * @return 0 on success, non-0 on error
  *
  * See <a href="http://tools.ietf.org/html/rfc2388#section-3">RFC 2388 s3</a>
@@ -712,7 +713,7 @@ char *mime_to_qp(const char *text) {
       ++linelength;
     } else {
       /* Anything else that needs encoding */
-      snprintf(buffer, sizeof buffer, "=%02X", c);
+      byte_snprintf(buffer, sizeof buffer, "=%02X", c);
       dynstr_append_string(d, buffer);
       linelength += 3;
     }