X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=sbr%2Fm_draft.c;h=549e89b6aecd56504d9e98b98c869ac8d8543ad5;hb=5901f87be7eaf0475af7c6c1e139ed844468643c;hp=427d2dbc83534ea2c70f6ba50e6829c6bb8305cc;hpb=0f56dec07e0eda5042276a5e65cb51ea95c23ff9;p=mmh diff --git a/sbr/m_draft.c b/sbr/m_draft.c index 427d2db..549e89b 100644 --- a/sbr/m_draft.c +++ b/sbr/m_draft.c @@ -9,6 +9,7 @@ #include #include #include +#include /* @@ -18,15 +19,16 @@ char * m_draft(char *which) { - register struct msgs *mp; + struct msgs *mp; static char buffer[BUFSIZ]; char *folder; folder = getcpy(toabsdir(draftfolder)); - create_folder(folder, 0, done); + create_folder(folder, 0, exit); if (!(mp = folder_read(folder))) { - adios(NULL, "unable to read folder %s", folder); + adios(EX_IOERR, NULL, "unable to read folder %s", folder); } + free(folder); /* ** Make sure we have enough message status space for all @@ -36,10 +38,10 @@ m_draft(char *which) */ if (mp->hghmsg >= mp->hghoff) { if (!(mp = folder_realloc(mp, 1, mp->hghmsg + 10))) - adios(NULL, "unable to allocate folder storage"); + adios(EX_OSERR, NULL, "unable to allocate folder storage"); } else if (mp->lowoff > 1) { if (!(mp = folder_realloc(mp, 1, mp->hghoff))) - adios(NULL, "unable to allocate folder storage"); + adios(EX_OSERR, NULL, "unable to allocate folder storage"); } mp->msgflags |= ALLOW_BEYOND; /* allow the beyond sequence */ @@ -50,7 +52,7 @@ m_draft(char *which) ** (to start a new draft). */ if (!m_convert(mp, which)) - done(1); + exit(EX_SOFTWARE); seq_setprev(mp); snprintf(buffer, sizeof(buffer), "%s/%s", mp->foldpath,