dthelp: Change to ANSI function definitions
[oweals/cde.git] / cde / programs / dtmail / dtmail / Attachment.C
index ce48372119faad7720ed2d4390b8663ee30983ee..905bf43e081774b6b60213e123078a6994d6b9ef 100644 (file)
@@ -1,3 +1,25 @@
+/*
+ * CDE - Common Desktop Environment
+ *
+ * Copyright (c) 1993-2012, The Open Group. All rights reserved.
+ *
+ * These libraries and programs are free software; you can
+ * redistribute them and/or modify them under the terms of the GNU
+ * Lesser General Public License as published by the Free Software
+ * Foundation; either version 2 of the License, or (at your option)
+ * any later version.
+ *
+ * These libraries and programs are distributed in the hope that
+ * they will be useful, but WITHOUT ANY WARRANTY; without even the
+ * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * 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
+ */
 /* $TOG: Attachment.C /main/16 1998/07/23 17:58:44 mgreess $
  *
  * (c) Copyright 1996 Digital Equipment Corporation.
@@ -161,6 +183,24 @@ Attachment::Attachment(
        _label = XmStringCreateLocalized(strrchr(name, '/')+1);
 
     _key = theRoamApp.session()->session()->newObjectKey();
+    
+    myIcon = NULL;
+    _background = 0;
+    _foreground = 0;
+    _attachmentWidth = 0;
+    _attachmentHeight = 0;
+    _positionX = 0;
+    _positionY = 0;
+    _deleted = false;
+    _selected = false;
+    _row = 0;
+    _saveAsFilename = NULL;
+    _ce_name = NULL;
+    _ce_type = NULL;
+    _type = 0;
+    _binary = false;
+    _executable = false;
+    
 }
 
 Attachment::~Attachment(
@@ -417,7 +457,7 @@ Attachment::invokeAction(int index)
        int answer;
        char *buf = new char[2048];
 
-       sprintf(buf,
+       sprintf(buf, "%s",
                GETMSG(DT_catd, 3, 81, "This attachment may contain commands that can cause serious\ndamage.  It is recommended that you only execute it after you\nare certain it is safe to do so.\n\nPress OK if you are certain it is safe,\nCancel to cancel execution."));
 
        answer = parent()->handleQuestionDialog(
@@ -846,7 +886,7 @@ Attachment::action(
        /* NL_COMMENT
         * Post a dialog explaining that the action was invalid
         */
-       sprintf(buf, 
+       sprintf(buf, "%s",
                GETMSG(
                        DT_catd, 3, 91, "Cannot execute invalid action."));
 
@@ -861,7 +901,7 @@ Attachment::action(
        /* NL_COMMENT 
         * Post a dialog explaining that the action failed.
         */
-       sprintf(buf, 
+       sprintf(buf, "%s",
                GETMSG(DT_catd, 3, 92, "Executing action failed!"));
 
        answer = parent()->handleErrorDialog(GETMSG(DT_catd, 1, 86, "Mailer"),
@@ -1207,7 +1247,7 @@ Attachment::setContents()
            size = strlen(from_hdr) + int(_myContentsSize) + 3;
            buffer = new char[size];
 
-           // Look for the first occurance of a colon or a newline.
+           // Look for the first occurrence of a colon or a newline.
            char *sptr;
            for (sptr = (char*) _myContents;
                 *sptr && *sptr != '\n' && *sptr != ':';