move buffer.[hc] into lib-lib/
[apps/madmutt.git] / score.c
diff --git a/score.c b/score.c
index 5d401dc..7d04fb4 100644 (file)
--- a/score.c
+++ b/score.c
 # include "config.h"
 #endif
 
+#include <lib-lib/mem.h>
+#include <lib-lib/macros.h>
+#include <lib-lib/buffer.h>
+
 #include "mutt.h"
 #include "sort.h"
-#include "buffer.h"
-
-#include "lib/mem.h"
-#include "lib/intl.h"
 
 #include <string.h>
 #include <stdlib.h>
@@ -68,10 +68,10 @@ int mutt_parse_score (BUFFER * buf, BUFFER * s, unsigned long data,
     return (-1);
   }
   pattern = buf->data;
-  memset (buf, 0, sizeof (BUFFER));
+  p_clear(buf, 1);
   mutt_extract_token (buf, s, 0);
   if (MoreArgs (s)) {
-    mem_free (&pattern);
+    p_delete(&pattern);
     strfcpy (err->data, _("score: too many arguments"), err->dsize);
     return (-1);
   }
@@ -83,10 +83,10 @@ int mutt_parse_score (BUFFER * buf, BUFFER * s, unsigned long data,
       break;
   if (!ptr) {
     if ((pat = mutt_pattern_comp (pattern, 0, err)) == NULL) {
-      mem_free (&pattern);
+      p_delete(&pattern);
       return (-1);
     }
-    ptr = mem_calloc (1, sizeof (SCORE));
+    ptr = p_new(SCORE, 1);
     if (last)
       last->next = ptr;
     else
@@ -141,7 +141,7 @@ int mutt_parse_unscore (BUFFER * buf, BUFFER * s, unsigned long data,
         last = tmp;
         tmp = tmp->next;
         mutt_pattern_free (&last->pat);
-        mem_free (&last);
+        p_delete(&last);
       }
       Score = NULL;
     }
@@ -153,7 +153,7 @@ int mutt_parse_unscore (BUFFER * buf, BUFFER * s, unsigned long data,
           else
             Score = tmp->next;
           mutt_pattern_free (&tmp->pat);
-          mem_free (&tmp);
+          p_delete(&tmp);
           /* there should only be one score per pattern, so we can stop here */
           break;
         }