* details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with these librararies and programs; if not, write
+ * License along with these libraries and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
+#include <stdint.h>
#include <pwd.h>
#include <X11/Intrinsic.h>
#include <Xm/Text.h>
) : RoamInterruptibleCmd (name, label, active)
{
_menuWindow = window;
+ _open_create_flag = DTM_FALSE;
+ _open_lock_flag = DTM_FALSE;
}
// Parent's execute() ends up calling derived class's doit()
_num_converted = 0;
_num_to_be_converted = 0;
_dialog = NULL;
+ _criteria = NULL;
+ _conv_cb = NULL;
+ _src = NULL;
+ _dest = NULL;
}
void
char * buf = new char[25];
- sprintf(buf, "Converted: %3d%", 0);
+ sprintf(buf, "Converted: %3d%%", 0);
_dialog->post ("Mailer",
buf,
) : NoUndoCmd( name, label, active )
{
_menuwindow = window;
+ _msgno = NULL;
}
void
) : Cmd ( name, label, active )
{
_menuwindow = window;
+ _msgno = NULL;
}
void
this,
parent)
{
+ _only_show_mailboxes = DTM_FALSE;
+
if (! _is_initialized)
{
FORCE_SEGV_DECL(DtMail::Session, m_session);
_menuwindow = window;
_undelFromList = NULL;
_fromList = viaDeleteList;
+ _clientData = NULL;
+ _num_deleted = 0;
}
UndeleteCmd::~UndeleteCmd()
_menuwindow = menu_window;
_copy_button = NULL;
_move_button = NULL;
+ _file_list = NULL;
+ _file_text = NULL;
+ _default_button = NULL;
}
MoveCopyCmd::~MoveCopyCmd()
// If a string was successfully extracted, call
// unifiedMailboxSelected to handle the file.
*selected = '\0';
- if (NULL != dname) strcat(selected, dname);
+ if (NULL != dname) snprintf(selected, sizeof(selected), "%s", dname);
strcat(selected, fname);
obj->updateUnifiedData();
obj->unifiedMailboxSelected(
DebugPrintf(1, "%s: printit\n", name());
// Create tmp file.
- sprintf(tmpdir, "%s/%s", getenv("HOME"), DtPERSONAL_TMP_DIRECTORY);
+ snprintf(tmpdir, MAXPATHLEN+1, "%s/%s", getenv("HOME"), DtPERSONAL_TMP_DIRECTORY);
if ((p = tempnam(tmpdir, "dtmail")) == NULL) {
delete [] tmpdir;
return;
parent)
{
_parent = clientData;
+ _name = NULL;
}
SaveAttachCmd::SaveAttachCmd (
parent )
{
_parent = clientData;
+ _name = NULL;
}
SaveAttachCmd::SaveAttachCmd (
parent )
{
_parent = clientData;
+ _name = NULL;
}
void
// Create temp file.
//
char *tmpdir = new char[MAXPATHLEN+1];
- sprintf(tmpdir, "%s/%s", getenv("HOME"), DtPERSONAL_TMP_DIRECTORY);
+ snprintf(tmpdir, MAXPATHLEN+1, "%s/%s", getenv("HOME"), DtPERSONAL_TMP_DIRECTORY);
if ((tmppath = tempnam(tmpdir, "dtmail")) == NULL) {
- sprintf(buf, GETMSG(DT_catd, 3, 51, "Unable to create %s."), tmpdir);
+ snprintf(buf, sizeof(buf), GETMSG(DT_catd, 3, 51, "Unable to create %s."), tmpdir);
_genDialog->setToErrorDialog(GETMSG(DT_catd, 3, 52, "Mailer"), buf);
helpId = DTMAILHELPNOCREATE;
_genDialog->post_and_return(helpId);
int active)
: NoUndoCmd (name, label, active)
{
+ _header = NULL;
}
void
{
char *forwardfile = new char[MAXPATHLEN+1];
- sprintf(forwardfile, "%s/%s", getenv("HOME"), _forwardFile);
+ snprintf(forwardfile, MAXPATHLEN+1, "%s/%s", getenv("HOME"), _forwardFile);
// Remove the current .forward file (it has vacation in it)
// Recover and replace the original backup forward file, if
Boolean retval = FALSE;
char *forwardfile = new char[MAXPATHLEN+1];
- sprintf(forwardfile, "%s/%s", getenv("HOME"), _forwardFile);
+ snprintf(forwardfile, MAXPATHLEN+1, "%s/%s", getenv("HOME"), _forwardFile);
if (SafeAccess(forwardfile, F_OK) != 0) {
delete [] forwardfile;
delete [] messagefile;
delete [] error_buf;
delete [] forwardfile;
+ SafeClose(bkup_fd);
SafeClose(fwd_fd);
return 1;
}
strlen(append_buf2)) {
// error
SafeClose(bkup_fd);
+ SafeClose(fwd_fd);
delete [] buf;
delete [] messagefile;
delete [] error_buf;
return(-1);
}
- if ((fd = SafeOpen(file, O_RDONLY)) == 0) {
+ if ((fd = SafeOpen(file, O_RDONLY)) == -1) {
delete [] buf;
return(-1);
}
size_t map_size = (int) (buf.st_size +
(page_size - (buf.st_size % page_size)));
- if (buf.st_size == 0)
+ if (buf.st_size == 0) {
+ SafeClose(fd);
return;
+ }
int free_buf = 0;
mbuf.size = buf.st_size;
-#ifdef __osf__
- mbuf.buffer = (char *)mmap(0, map_size, PROT_READ, MAP_PRIVATE, fd, 0);
-#else
mbuf.buffer = mmap(0, map_size, PROT_READ, MAP_PRIVATE, fd, 0);
-#endif
if (mbuf.buffer == (char *)-1) {
free_buf = 1;
mbuf.buffer = new char[mbuf.size];