rohrpost

A commandline mail client to change the world as we see it.
git clone git://r-36.net/rohrpost
Log | Files | Refs | LICENSE

commit 7ca71acba35012f303e8ed5266d6e111a6773aff
parent 11edd6f2bdca483d2e1624726d2df5b4532d80ef
Author: Christoph Lohmann <20h@r-36.net>
Date:   Wed, 26 Nov 2014 20:36:06 +0100

memdup -> memdups

Diffstat:
add.c | 2+-
cfg.c | 6+++---
copy.c | 2+-
flag.c | 2+-
ids.c | 2+-
imap.c | 10+++++-----
inc.c | 6+++---
ind.c | 2+-
llist.c | 2+-
mark.c | 8++++----
meta.c | 10+++++-----
mime.c | 6+++---
12 files changed, 29 insertions(+), 29 deletions(-)

diff --git a/add.c b/add.c @@ -99,7 +99,7 @@ addmain(int argc, char *argv[]) if (folder == NULL) { folder = config_checkgetstr(cfg, "selected"); } else { - folder = memdup(folder, strlen(folder)+1); + folder = memdups(folder); } config_free(cfg); diff --git a/cfg.c b/cfg.c @@ -36,13 +36,13 @@ config_init(char *cfgn) cfg = config_read(path); if (cfg == NULL) cfg = config_new(); - cfg->path = memdup(path, strlen(path)+1); + cfg->path = memdups(path); free(path); if (cfg->name == NULL) { - cfg->name = memdup("default", 8); + cfg->name = memdups("default"); } else { - cfg->name = memdup(cfgn, strlen(cfgn)+1); + cfg->name = memdups(cfgn); } return cfg; diff --git a/copy.c b/copy.c @@ -84,7 +84,7 @@ copymain(int argc, char *argv[]) if (selected == NULL) { selected = config_checkgetstr(cfg, "selected"); } else { - selected = memdupz(selected, strlen(selected)+1); + selected = memdups(selected); } config_free(cfg); diff --git a/flag.c b/flag.c @@ -150,7 +150,7 @@ flagmain(int argc, char *argv[]) if (selected == NULL) { selected = config_checkgetstr(cfg, "selected"); } else { - selected = memdup(selected, strlen(selected)+1); + selected = memdups(selected); } config_free(cfg); diff --git a/ids.c b/ids.c @@ -55,7 +55,7 @@ idsmain(int argc, char *argv[]) if (selected == NULL) { selected = config_checkgetstr(cfg, "selected"); } else { - selected = memdup(selected, strlen(selected)+1); + selected = memdups(selected); } config_free(cfg); diff --git a/imap.c b/imap.c @@ -26,9 +26,9 @@ imap_new(char *netspec, char *user, char *pass) imap_t *imap; imap = mallocz(sizeof(imap_t), 2); - imap->netspec = memdup(netspec, strlen(netspec)+1); - imap->user = memdup(user, strlen(user)+1); - imap->pass = memdup(pass, strlen(pass)+1); + imap->netspec = memdups(netspec); + imap->user = memdups(user); + imap->pass = memdups(pass); imap->starttls = 1; return imap; @@ -369,7 +369,7 @@ imap_parseline(imap_t *imap, llist_t **ret) line[len-1] = '\0'; if (imap->imaperror != NULL) free(imap->imaperror); - imap->imaperror = memdup(line, strlen(line)+1); + imap->imaperror = memdups(line); free(line); return retval; } @@ -1205,7 +1205,7 @@ imap_select(imap_t *imap, char *mb) if (!rstat) { if (imap->selected != NULL) free(imap->selected); - imap->selected = memdup(mb, strlen(mb)+1); + imap->selected = memdups(mb); } return rstat; diff --git a/inc.c b/inc.c @@ -35,10 +35,10 @@ inc_init(char *cfgn) incs = inc_read(path); if (incs == NULL) incs = inc_new(); - incs->path = memdup(path, strlen(path)+1); + incs->path = memdups(path); free(path); - incs->name = memdup(cfgn, strlen(cfgn)+1); + incs->name = memdups(cfgn); return incs; } @@ -96,7 +96,7 @@ inc_getstatuselem(inc_t *incs, char *mailbox, char *elem) llist_efree(status); return NULL; } - rstr = memdup(relem->key, strlen(relem->key)+1); + rstr = memdups(relem->key); llist_efree(status); return rstr; diff --git a/ind.c b/ind.c @@ -286,7 +286,7 @@ expandhome(char *path) retpath = smprintf("%s%s", home, path+1); } if (retpath == NULL) - retpath = memdup(path, strlen(path)+1); + retpath = memdups(path); return retpath; } diff --git a/llist.c b/llist.c @@ -653,7 +653,7 @@ llist_splitstr(char *str, char *sep) saveptr = NULL; - strc = memdup(str, strlen(str)+1); + strc = memdups(str); tok = strtok_r(strc, sep, &saveptr); if (tok == NULL) { diff --git a/mark.c b/mark.c @@ -35,11 +35,11 @@ mark_init(char *cfgn, char *mailbox) marks = mark_read(path); if (marks == NULL) marks = mark_new(); - marks->path = memdup(path, strlen(path)+1); + marks->path = memdups(path); free(path); - marks->data = memdup(mailbox, strlen(mailbox)+1); - marks->name = memdup(cfgn, strlen(cfgn)+1); + marks->data = memdups(mailbox); + marks->name = memdups(cfgn); return marks; } @@ -402,7 +402,7 @@ markmain(int argc, char *argv[]) die("Cannot proceed without any selected mailbox.\n"); config_stop(cfg); } else { - selected = memdup(selected, strlen(selected)+1); + selected = memdups(selected); } marks = mark_init(cfgn, selected); diff --git a/meta.c b/meta.c @@ -23,12 +23,12 @@ meta_mimedup(mime_t *mime) meta->body = memdup(mime->body, mime->bodylen); meta->bodylen = mime->bodylen; - meta->partid = memdup(mime->partid, strlen(mime->partid)+1); - meta->ct = memdup(mime->ct, strlen(mime->ct)+1); - meta->cte = memdup(mime->cte, strlen(mime->cte)+1); - meta->charset = memdup(mime->charset, strlen(mime->charset)+1); + meta->partid = memdups(mime->partid); + meta->ct = memdups(mime->ct); + meta->cte = memdups(mime->cte); + meta->charset = memdups(mime->charset); - meta->boundary = memdup(mime->boundary, strlen(mime->boundary)+1); + meta->boundary = memdups(mime->boundary); meta->state = mime->state; diff --git a/mime.c b/mime.c @@ -420,7 +420,7 @@ mime_encodestring(char *value) char *b64, *ret; if (strisascii(value)) - return memdup(value, strlen(value)+1); + return memdups(value); b64 = b64enc(value, strlen(value)); ret = smprintf("=?UTF-8?b?%s?=", b64); @@ -589,7 +589,7 @@ mime_parseheader(char *field) llist_t *ret; int tlen; - buf = memdup(field, strlen(field)+1); + buf = memdups(field); tok = buf; ret = llist_new(); @@ -816,7 +816,7 @@ mime_preparepart(mime_t *mime) mime->boundary = smprintf("--%s", (char *)field->data); //printf("boundary: \"%s\"\n", mime->boundary); } - mime->ct = memdupz(hdrf->first->key, strlen(hdrf->first->key)); + mime->ct = memdups(hdrf->first->key); field = llist_ciget(hdrf, "charset"); if (field != NULL && field->data != NULL)