-folder_addmsg (struct msgs **mpp, char *msgfile, int selected,
+folder_addmsg(struct msgs **mpp, char *msgfile, int selected,
int unseen, int preserve, int deleting, char *from_dir)
{
int infd, outfd, linkerr, msgnum;
int unseen, int preserve, int deleting, char *from_dir)
{
int infd, outfd, linkerr, msgnum;
** If a message is already in that slot,
** then loop to next available slot.
*/
** If a message is already in that slot,
** then loop to next available slot.
*/
- clear_msg_flags (mp, msgnum);
- set_exists (mp, msgnum);
+ clear_msg_flags(mp, msgnum);
+ set_exists(mp, msgnum);
- nmsg = m_name (msgnum);
- snprintf (newmsg, sizeof(newmsg), "%s/%s", mp->foldpath, nmsg);
+ nmsg = m_name(msgnum);
+ snprintf(newmsg, sizeof(newmsg), "%s/%s", mp->foldpath, nmsg);
if (deleting) {
(void)snprintf(oldmsg, sizeof (oldmsg), "%s/%s", from_dir, msgfile);
if (deleting) {
(void)snprintf(oldmsg, sizeof (oldmsg), "%s/%s", from_dir, msgfile);
- if (stat (newmsg, &st1) == 0) {
- advise (NULL, "message %s:%s already exists", mp->foldpath, newmsg);
+ if (stat(newmsg, &st1) == 0) {
+ advise(NULL, "message %s:%s already exists", mp->foldpath, newmsg);
- if ((infd = open (msgfile, O_RDONLY)) == -1) {
- advise (msgfile, "unable to open message %s", msgfile);
+ if ((infd = open(msgfile, O_RDONLY)) == -1) {
+ advise(msgfile, "unable to open message %s", msgfile);
- fstat (infd, &st1);
- if ((outfd = creat (newmsg, (int) st1.st_mode & 0777)) == -1) {
- advise (newmsg, "unable to create");
- close (infd);
+ fstat(infd, &st1);
+ if ((outfd = creat(newmsg, (int) st1.st_mode & 0777)) == -1) {
+ advise(newmsg, "unable to create");
+ close(infd);
- cpydata (infd, outfd, msgfile, newmsg);
- close (infd);
- close (outfd);
+ cpydata(infd, outfd, msgfile, newmsg);
+ close(infd);
+ close(outfd);
if (deleting) {
(void)snprintf(oldmsg, sizeof (oldmsg), "%s/%s", from_dir, msgfile);
if (deleting) {
(void)snprintf(oldmsg, sizeof (oldmsg), "%s/%s", from_dir, msgfile);