X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=lib.c;fp=lib.c;h=e683c6d37b73241feec307097b103bdcd914e674;hp=4f1fee35ad93496eccf43d0b39aa16e1bb073f9f;hb=8e037c67a88cb4680c4391134c578e3b55a80f8a;hpb=c25bc063f35aaad6938c2022dae7a283346c2769 diff --git a/lib.c b/lib.c index 4f1fee3..e683c6d 100644 --- a/lib.c +++ b/lib.c @@ -34,6 +34,8 @@ #define EX_OK 0 #endif +#include + #include "lib.h" #include "lib/mem.h" @@ -391,19 +393,19 @@ int mutt_rx_sanitize_string (char *dest, size_t destlen, const char *src) * If a line ends with "\", this char and the linefeed is removed, * and the next line is read too. */ -char *mutt_read_line (char *s, size_t * size, FILE * fp, int *line) +char *mutt_read_line(char *s, size_t * size, FILE * fp, int *line) { size_t offset = 0; char *ch; if (!s) { - s = mem_malloc (STRING); + s = p_new(char, STRING); *size = STRING; } FOREVER { if (fgets (s + offset, *size - offset, fp) == NULL) { - mem_free (&s); + p_delete(&s); return NULL; } if ((ch = strchr (s + offset, '\n')) != NULL) {